max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
main.py | adadesions/PacInverter | 0 | 6627451 | import sys
import getopt
import time
from components.PacpowerAPI import PacpowerAPI
if __name__ == '__main__':
opts, args = getopt.getopt(sys.argv[1:], 'u:p:s:v:l:',
['user=', 'pass=', 'storage=', 'volt=', 'location='])
parsed_argv = {
'user': '', 'pass': '', 'storage_id': '', 'max_volt': '', 'lo... | import sys
import getopt
import time
from components.PacpowerAPI import PacpowerAPI
if __name__ == '__main__':
opts, args = getopt.getopt(sys.argv[1:], 'u:p:s:v:l:',
['user=', 'pass=', 'storage=', 'volt=', 'location='])
parsed_argv = {
'user': '', 'pass': '', 'storage_id': '', 'max_volt': '', 'lo... | none | 1 | 2.238535 | 2 | |
modules/cls_ffn.py | TUIlmenauAMS/nca_mss | 2 | 6627452 | # -*- coding: utf-8 -*-
__author__ = '<NAME>'
__copyright__ = 'MacSeNet'
import torch
import torch.nn as nn
from torch.autograd import Variable
class DFFN(nn.Module):
def __init__(self, N, l_dim):
"""
Constructing blocks for a two-layer FFN.
Args :
N : (int) Original dim... | # -*- coding: utf-8 -*-
__author__ = '<NAME>'
__copyright__ = 'MacSeNet'
import torch
import torch.nn as nn
from torch.autograd import Variable
class DFFN(nn.Module):
def __init__(self, N, l_dim):
"""
Constructing blocks for a two-layer FFN.
Args :
N : (int) Original dim... | en | 0.700579 | # -*- coding: utf-8 -*- Constructing blocks for a two-layer FFN. Args : N : (int) Original dimensionallity of the input. l_dim : (int) Dimensionallity of the latent variables. # Encoder # Decoder # Initialize the weights Manual weight/bias initialization. # Matrices # Encoder # Dec... | 2.977417 | 3 |
genmotion/algorithm/action2motion/utils/matrix_transformer.py | yizhouzhao/GenMotion | 32 | 6627453 | import numpy as np
class MatrixTransformer(object):
@staticmethod
def rotate_along_x(matrix, theta):
Rx = np.array([[1, 0, 0],
[0, np.cos(theta), np.sin(theta)],
[0, -np.sin(theta), np.cos(theta)]])
return np.dot(matrix, Rx)
@staticmethod
... | import numpy as np
class MatrixTransformer(object):
@staticmethod
def rotate_along_x(matrix, theta):
Rx = np.array([[1, 0, 0],
[0, np.cos(theta), np.sin(theta)],
[0, -np.sin(theta), np.cos(theta)]])
return np.dot(matrix, Rx)
@staticmethod
... | en | 0.685145 | project 3d points to original 2d coordinate space. Input: cam: (1, 3) camera parameters (f, cx, cy) output by model. verts: 3d verts output by model. proc_param: preprocessing parameters. this is for converting points from crop (model input) to original image. Output: | 2.876765 | 3 |
ansible_collections/ctera/ctera/plugins/module_utils/ctera_runner_base.py | ctera/ctera-ansible-collection | 0 | 6627454 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is licensed under the Apache License 2.0.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is licensed under the Apache License 2.0.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | en | 0.891646 | # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is licensed under the Apache License 2.0. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic... | 1.755672 | 2 |
arsenic/change_readnames_clr.py | jason-weirather/Au-public | 4 | 6627455 | #!/usr/bin/python
from __future__ import print_function
import sys
import os
#Adds subscripts to reads generated by PBSIM
if len(sys.argv) >= 3:
fastq_filename = sys.argv[1]
batchnum = sys.argv[2]
else:
print("usage: python change_readnames.py fastq_filename batchnum > fastq_out")
sys.exit(1)
reads=... | #!/usr/bin/python
from __future__ import print_function
import sys
import os
#Adds subscripts to reads generated by PBSIM
if len(sys.argv) >= 3:
fastq_filename = sys.argv[1]
batchnum = sys.argv[2]
else:
print("usage: python change_readnames.py fastq_filename batchnum > fastq_out")
sys.exit(1)
reads=... | en | 0.792734 | #!/usr/bin/python #Adds subscripts to reads generated by PBSIM | 2.59813 | 3 |
Python/Warmup_2/array123.py | RCoon/CodingBat | 1 | 6627456 | # Given an array of ints, return True if .. 1, 2, 3, .. appears in the array
# somewhere.
# array123([1, 1, 2, 3, 1]) --> True
# array123([1, 1, 2, 4, 1]) --> False
# array123([1, 1, 2, 1, 2, 3]) --> True
def array123(nums):
a = [1,2,3]
return set(a).issubset(nums)
print(array123([1, 1, 2, 3, 1]))
print(array12... | # Given an array of ints, return True if .. 1, 2, 3, .. appears in the array
# somewhere.
# array123([1, 1, 2, 3, 1]) --> True
# array123([1, 1, 2, 4, 1]) --> False
# array123([1, 1, 2, 1, 2, 3]) --> True
def array123(nums):
a = [1,2,3]
return set(a).issubset(nums)
print(array123([1, 1, 2, 3, 1]))
print(array12... | en | 0.384942 | # Given an array of ints, return True if .. 1, 2, 3, .. appears in the array # somewhere. # array123([1, 1, 2, 3, 1]) --> True # array123([1, 1, 2, 4, 1]) --> False # array123([1, 1, 2, 1, 2, 3]) --> True | 3.877677 | 4 |
setup_app/installers/httpd.py | threema-gmbh/community-edition-setup | 0 | 6627457 | <reponame>threema-gmbh/community-edition-setup
import os
import glob
import shutil
from setup_app import paths
from setup_app.utils import base
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.installers.base impor... | import os
import glob
import shutil
from setup_app import paths
from setup_app.utils import base
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.installers.base import BaseInstaller
class HttpdInstaller(BaseInsta... | en | 0.807666 | # we don't need backend connection in this class # we only need these modules # generate httpd self signed certificate # CentOS 7.* + systemd + apache 2.4 | 2.081866 | 2 |
xarray/core/concat.py | jminsk-cc/xarray | 0 | 6627458 | <reponame>jminsk-cc/xarray
import warnings
from collections import OrderedDict
import pandas as pd
from . import dtypes, utils
from .alignment import align
from .variable import IndexVariable, Variable, as_variable
from .variable import concat as concat_vars
def concat(
objs,
dim=None,
data_vars="all",
... | import warnings
from collections import OrderedDict
import pandas as pd
from . import dtypes, utils
from .alignment import align
from .variable import IndexVariable, Variable, as_variable
from .variable import concat as concat_vars
def concat(
objs,
dim=None,
data_vars="all",
coords="different",
... | en | 0.790142 | Concatenate xarray objects along a new or existing dimension. Parameters ---------- objs : sequence of Dataset and DataArray objects xarray objects to concatenate together. Each object is expected to consist of variables and coordinates with matching shapes except for along the conc... | 3.05288 | 3 |
dev/Tools/build/waf-1.7.13/waflib/extras/build_logs.py | jeikabu/lumberyard | 10 | 6627459 | <reponame>jeikabu/lumberyard
#!/usr/bin/env python
# encoding: utf-8
# <NAME>, 2013 (ita)
"""
A system for recording all outputs to a log file. Just add the following to your wscript file::
def init(ctx):
ctx.load('build_logs')
"""
import atexit, sys, time, os, shutil, threading
from waflib import Logs, Contex... | #!/usr/bin/env python
# encoding: utf-8
# <NAME>, 2013 (ita)
"""
A system for recording all outputs to a log file. Just add the following to your wscript file::
def init(ctx):
ctx.load('build_logs')
"""
import atexit, sys, time, os, shutil, threading
from waflib import Logs, Context
# adding the logs under th... | en | 0.674476 | #!/usr/bin/env python # encoding: utf-8 # <NAME>, 2013 (ita) A system for recording all outputs to a log file. Just add the following to your wscript file:: def init(ctx): ctx.load('build_logs') # adding the logs under the build/ directory will clash with the clean/ command # sys.stdout has already been replaced... | 2.305225 | 2 |
tripled/stack/resource.py | yeasy/tripled | 1 | 6627460 | __author__ = 'baohua'
class Resource(object):
"""
Resource :
"""
def __init__(self, name=None, *args, **kwargs):
self.name = name
self.attributes = args
self.options = kwargs
def __str__(self):
"""Get string to show the resource attributes
:param:
... | __author__ = 'baohua'
class Resource(object):
"""
Resource :
"""
def __init__(self, name=None, *args, **kwargs):
self.name = name
self.attributes = args
self.options = kwargs
def __str__(self):
"""Get string to show the resource attributes
:param:
... | en | 0.364314 | Resource : Get string to show the resource attributes :param: :returns: a dict e.g., {'resource_name':[string1, string2, ...]} | 3.356594 | 3 |
chapter5/alarmclock.py | chavo1/playground-python | 0 | 6627461 | import time
current_time = time.localtime()
hour = current_time.tm_hour
minute = current_time.tm_min
it_is_time_to_get_up = (hour>7) or (hour==7 and minute>29)
if it_is_time_to_get_up:
print('IT IS TIME TO GET UP')
| import time
current_time = time.localtime()
hour = current_time.tm_hour
minute = current_time.tm_min
it_is_time_to_get_up = (hour>7) or (hour==7 and minute>29)
if it_is_time_to_get_up:
print('IT IS TIME TO GET UP')
| none | 1 | 3.564881 | 4 | |
aes.py | ahmedalsawi/wecli | 0 | 6627462 | # -*- coding: utf-8 -*-
# Python 3.4
# author: http://blog.dokenzy.com/
# date: 2015. 4. 8
# References
# http://www.imcore.net/encrypt-decrypt-aes256-c-objective-ios-iphone-ipad-php-java-android-perl-javascript/
# http://stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python
# http://stackover... | # -*- coding: utf-8 -*-
# Python 3.4
# author: http://blog.dokenzy.com/
# date: 2015. 4. 8
# References
# http://www.imcore.net/encrypt-decrypt-aes256-c-objective-ios-iphone-ipad-php-java-android-perl-javascript/
# http://stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python
# http://stackover... | en | 0.549518 | # -*- coding: utf-8 -*- # Python 3.4 # author: http://blog.dokenzy.com/ # date: 2015. 4. 8 # References # http://www.imcore.net/encrypt-decrypt-aes256-c-objective-ios-iphone-ipad-php-java-android-perl-javascript/ # http://stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python # http://stackoverfl... | 3.42996 | 3 |
galaxy/main/tests/test_content_block_model.py | thadguidry/galaxy | 0 | 6627463 | # -*- coding: utf-8 -*-
# (c) 2012-2018, Ansible
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any late... | # -*- coding: utf-8 -*-
# (c) 2012-2018, Ansible
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any late... | en | 0.841654 | # -*- coding: utf-8 -*- # (c) 2012-2018, Ansible # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any late... | 1.982759 | 2 |
scripts/analytics/addon_snapshot.py | saradbowman/osf.io | 0 | 6627464 | <filename>scripts/analytics/addon_snapshot.py
from __future__ import absolute_import
import logging
# App must be initialized before models or ADDONS_AVAILABLE are available
from website.app import init_app
init_app()
from osf.models import OSFUser, AbstractNode
from framework.database import paginated
from scripts.... | <filename>scripts/analytics/addon_snapshot.py
from __future__ import absolute_import
import logging
# App must be initialized before models or ADDONS_AVAILABLE are available
from website.app import init_app
init_app()
from osf.models import OSFUser, AbstractNode
from framework.database import paginated
from scripts.... | en | 0.863746 | # App must be initialized before models or ADDONS_AVAILABLE are available # Modified from scripts/analytics/benchmarks.py Gather the number of users who have at least one node in each of the stages for an addon :param user_settings_list: list of user_settings for a particualr addon :param has_external_account:... | 2.096857 | 2 |
npbench/benchmarks/channel_flow/channel_flow_numba_n.py | frahlg/npbench | 27 | 6627465 | <reponame>frahlg/npbench
# Barba, <NAME>., and Forsyth, <NAME>. (2018).
# CFD Python: the 12 steps to Navier-Stokes equations.
# Journal of Open Source Education, 1(9), 21,
# https://doi.org/10.21105/jose.00021
# TODO: License
# (c) 2017 <NAME>, <NAME>.
# All content is under Creative Commons Attribution CC-BY 4.0,
# a... | # Barba, <NAME>., and Forsyth, <NAME>. (2018).
# CFD Python: the 12 steps to Navier-Stokes equations.
# Journal of Open Source Education, 1(9), 21,
# https://doi.org/10.21105/jose.00021
# TODO: License
# (c) 2017 <NAME>, <NAME>.
# All content is under Creative Commons Attribution CC-BY 4.0,
# and all code is under BSD-... | en | 0.813897 | # Barba, <NAME>., and Forsyth, <NAME>. (2018). # CFD Python: the 12 steps to Navier-Stokes equations. # Journal of Open Source Education, 1(9), 21, # https://doi.org/10.21105/jose.00021 # TODO: License # (c) 2017 <NAME>, <NAME>. # All content is under Creative Commons Attribution CC-BY 4.0, # and all code is under BSD-... | 2.743735 | 3 |
tests/STDF/test_EPS.py | awinia-github/Semi-ATE-STDF | 0 | 6627466 | <reponame>awinia-github/Semi-ATE-STDF
import os
import tempfile
from tests.STDF.STDFRecordTest import STDFRecordTest
from STDF import EPS
# End Program Section Record
# Function:
# Marks the end of the current program section (or sequencer) in the job plan.
def test_EPS():
eps('<')
eps('>')
def eps(end... | import os
import tempfile
from tests.STDF.STDFRecordTest import STDFRecordTest
from STDF import EPS
# End Program Section Record
# Function:
# Marks the end of the current program section (or sequencer) in the job plan.
def test_EPS():
eps('<')
eps('>')
def eps(end):
# ATDF page 58
expected_... | en | 0.639914 | # End Program Section Record # Function: # Marks the end of the current program section (or sequencer) in the job plan. # ATDF page 58 # record length in bytes # STDF v4 page 63 # Test serialization # 1. Save EPS STDF record into a file # 2. Read byte by byte and compare with expected value # ERRO... | 2.560037 | 3 |
python/ee/tests/collection_test.py | Danielbatista0590/earthengine-api | 1 | 6627467 | <filename>python/ee/tests/collection_test.py
#!/usr/bin/env python
"""Test for the ee.collection module."""
import datetime
import unittest
import ee
from ee import apitestcase
class CollectionTestCase(apitestcase.ApiTestCase):
def testSortAndLimit(self):
"""Verifies the behavior of the sort() and limit()... | <filename>python/ee/tests/collection_test.py
#!/usr/bin/env python
"""Test for the ee.collection module."""
import datetime
import unittest
import ee
from ee import apitestcase
class CollectionTestCase(apitestcase.ApiTestCase):
def testSortAndLimit(self):
"""Verifies the behavior of the sort() and limit()... | en | 0.719278 | #!/usr/bin/env python Test for the ee.collection module. Verifies the behavior of the sort() and limit() methods. Verifies the behavior of filter() method. # We don't allow empty filters. Verifies the behavior of the various filtering shortcut methods. Verifies the behavior of the map() method. # Need to do a serialize... | 2.780401 | 3 |
phasedArrayScript.py | alexsludds/Phased-Array-Plotter | 0 | 6627468 | import numpy as np
import matplotlib.pyplot as plt
numberOfAntennas = 2
phaseDifferenceBetweenAntennasInDegrees = 30
frequencyOfOperationInHertz = 5.*10**(8) #500Mhz
speedOfPropogationInMedium = 3.*10**(8) #speed of light in meters per second
distanceBetweenFirstAndLastAntenna = 2 #in meters
wavelength = frequencyOfOpe... | import numpy as np
import matplotlib.pyplot as plt
numberOfAntennas = 2
phaseDifferenceBetweenAntennasInDegrees = 30
frequencyOfOperationInHertz = 5.*10**(8) #500Mhz
speedOfPropogationInMedium = 3.*10**(8) #speed of light in meters per second
distanceBetweenFirstAndLastAntenna = 2 #in meters
wavelength = frequencyOfOpe... | en | 0.753811 | #500Mhz #speed of light in meters per second #in meters #ax.set_rticks([0.5, 1, 1.5, 2]) # less radial ticks # get radial labels away from plotted line | 2.820312 | 3 |
products/admin.py | kevin-ci/janeric2 | 1 | 6627469 | <reponame>kevin-ci/janeric2<gh_stars>1-10
from django.contrib import admin
from .models import Product, Category, Product_Family, ProductSize
# Register your models here.
class ProductAdmin(admin.ModelAdmin):
list_display = (
'active',
'SKU',
'name',
'product_family',
'cat... | from django.contrib import admin
from .models import Product, Category, Product_Family, ProductSize
# Register your models here.
class ProductAdmin(admin.ModelAdmin):
list_display = (
'active',
'SKU',
'name',
'product_family',
'category',
'image',
'product_... | en | 0.968259 | # Register your models here. | 1.901247 | 2 |
pubnub/models/consumer/push.py | 17media/pubnub-python | 0 | 6627470 |
class PNPushAddChannelResult(object):
pass
class PNPushRemoveChannelResult(object):
pass
class PNPushRemoveAllChannelsResult(object):
pass
class PNPushListProvisionsResult(object):
def __init__(self, channels):
self.channels = channels
|
class PNPushAddChannelResult(object):
pass
class PNPushRemoveChannelResult(object):
pass
class PNPushRemoveAllChannelsResult(object):
pass
class PNPushListProvisionsResult(object):
def __init__(self, channels):
self.channels = channels
| none | 1 | 1.869534 | 2 | |
habitat/core/dataset.py | Lucaweihs/habitat-lab | 1 | 6627471 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""Implements dataset functionality to be used ``habitat.EmbodiedTask``.
``habitat.core.dataset`` abstracts over a colle... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""Implements dataset functionality to be used ``habitat.EmbodiedTask``.
``habitat.core.dataset`` abstracts over a colle... | en | 0.840428 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Implements dataset functionality to be used ``habitat.EmbodiedTask``. ``habitat.core.dataset`` abstracts over a collection... | 2.677088 | 3 |
function_scheduling_distributed_framework/publishers/rocketmq_publisher.py | lokibin1010/distributed_framework | 1 | 6627472 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2020/7/9 0008 12:12
import time
from function_scheduling_distributed_framework import frame_config
from function_scheduling_distributed_framework.publishers.base_publisher import AbstractPublisher
class RocketmqPublisher(AbstractPublisher, ):
... | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2020/7/9 0008 12:12
import time
from function_scheduling_distributed_framework import frame_config
from function_scheduling_distributed_framework.publishers.base_publisher import AbstractPublisher
class RocketmqPublisher(AbstractPublisher, ):
group_id__rocke... | en | 0.229933 | # -*- coding: utf-8 -*- # @Author : ydf # @Time : 2020/7/9 0008 12:12 # print(traceback.format_exc()) # 同一个进程中创建多个同组消费者会报错。 # print(traceback.format_exc()) # 利于检索 # rocket_msg.set_tags('XXX') # print(msg) | 2.191713 | 2 |
models/models.py | HP-bkeys/odoo-s3-storage | 0 | 6627473 | <filename>models/models.py
# -*- coding: utf-8 -*-
"""
s3-storage.models
~~~~~~~~~~~~~~~~~
Use s3 as file storage mechanism
:copyright: (c) 2017 by brolycjw.
:license: MIT License, see LICENSE for more details.
"""
import hashlib
from odoo import models
import s3_helper
class S3Attachment(mod... | <filename>models/models.py
# -*- coding: utf-8 -*-
"""
s3-storage.models
~~~~~~~~~~~~~~~~~
Use s3 as file storage mechanism
:copyright: (c) 2017 by brolycjw.
:license: MIT License, see LICENSE for more details.
"""
import hashlib
from odoo import models
import s3_helper
class S3Attachment(mod... | en | 0.855522 | # -*- coding: utf-8 -*- s3-storage.models ~~~~~~~~~~~~~~~~~ Use s3 as file storage mechanism :copyright: (c) 2017 by brolycjw. :license: MIT License, see LICENSE for more details. Extends ir.attachment to implement the S3 storage engine # Some old files (prior to the installation of odoo-S3) may # sti... | 2.239696 | 2 |
datasets/flow_datasets.py | Wassouli/Projet-prat | 0 | 6627474 | <reponame>Wassouli/Projet-prat
import imageio
import numpy as np
import random
from path import Path
from abc import abstractmethod, ABCMeta
from torch.utils.data import Dataset
from utils.flow_utils import load_flow
from PIL import Image
import os, sys
import glob
import matplotlib.pyplot as plt
from PIL import Image
... | import imageio
import numpy as np
import random
from path import Path
from abc import abstractmethod, ABCMeta
from torch.utils.data import Dataset
from utils.flow_utils import load_flow
from PIL import Image
import os, sys
import glob
import matplotlib.pyplot as plt
from PIL import Image
import os, sys
import imageio
f... | en | 0.786625 | #print("gggggg",self.root) # In unsupervised learning, there is no need to change target with image if self.target_transform is not None: for key in self.target_transform.keys(): target[key] = self.target_transform[key](target[key]) #txtfiles = [] #for file in glob.glob("*.txt"): # txtfile... | 2.47024 | 2 |
config.py | wizzicollo/Profile-Pitching-App | 0 | 6627475 | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://collins:qwertyui@localhost/pitchhs'
UPLOADED_PHOTOS_DEST = 'app/static/photo'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.envir... | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://collins:qwertyui@localhost/pitchhs'
UPLOADED_PHOTOS_DEST = 'app/static/photo'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.envir... | none | 1 | 2.048962 | 2 | |
client/log.py | s-pace/pyre-check | 5 | 6627476 | <filename>client/log.py
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List, O... | <filename>client/log.py
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List, O... | en | 0.837508 | # Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Preamble preparing terminal. # Reset terminal. | 2.408977 | 2 |
main/perl-io-socket-ssl/template.py | matu3ba/cports | 46 | 6627477 | pkgname = "perl-io-socket-ssl"
pkgver = "2.072"
pkgrel = 0
build_style = "perl_module"
hostmakedepends = ["gmake", "perl"]
makedepends = ["perl", "perl-net-ssleay", "perl-uri"]
depends = list(makedepends)
pkgdesc = "SSL sockets with IO::Socket interface"
maintainer = "q66 <<EMAIL>>"
license = "Artistic-1.0-Perl OR GPL-... | pkgname = "perl-io-socket-ssl"
pkgver = "2.072"
pkgrel = 0
build_style = "perl_module"
hostmakedepends = ["gmake", "perl"]
makedepends = ["perl", "perl-net-ssleay", "perl-uri"]
depends = list(makedepends)
pkgdesc = "SSL sockets with IO::Socket interface"
maintainer = "q66 <<EMAIL>>"
license = "Artistic-1.0-Perl OR GPL-... | en | 0.6098 | # missing checkdepends | 0.990335 | 1 |
dfp/agent_multimodal_advantage.py | minosworld/dfp | 4 | 6627478 | <reponame>minosworld/dfp<gh_stars>1-10
import numpy as np
import tensorflow as tf
from dfp import tf_ops as my_ops
from dfp.agent import Agent
class AgentMultimodalAdvantage(Agent):
def make_net(self, input_sensory, input_actions, input_objectives, reuse=False):
"""
Hooks up network for inferring... | import numpy as np
import tensorflow as tf
from dfp import tf_ops as my_ops
from dfp.agent import Agent
class AgentMultimodalAdvantage(Agent):
def make_net(self, input_sensory, input_actions, input_objectives, reuse=False):
"""
Hooks up network for inferring non-observed modalities for given time... | en | 0.70897 | Hooks up network for inferring non-observed modalities for given time step and for predicting future targets (measurement + subset of modalities) Args: input_sensory - tf placeholder for all modalities (includes both observed and ground truth for to be inferred modalities) in... | 2.412423 | 2 |
python-interface/src/MiniBotFramework/Sound/note_library.py | cornell-cup/cs-minibot-platform | 10 | 6627479 | <gh_stars>1-10
import pygame.mixer as pm
from pygame_play_tone import Note
from time import sleep
#Default volume for Notes
DEFAULT_VOLUME=0.2
# Notes that can be called on, where C4 is middle C
C0 = 16.35
C0_SHARP = 17.32
D0 = 18.35
D0_SHARP = 19.45
E0 = 20.6
F0 = 21.83
F0_SHARP = 23.12
G0 = 24.5
G0_SHARP = 25.96
A0... | import pygame.mixer as pm
from pygame_play_tone import Note
from time import sleep
#Default volume for Notes
DEFAULT_VOLUME=0.2
# Notes that can be called on, where C4 is middle C
C0 = 16.35
C0_SHARP = 17.32
D0 = 18.35
D0_SHARP = 19.45
E0 = 20.6
F0 = 21.83
F0_SHARP = 23.12
G0 = 24.5
G0_SHARP = 25.96
A0 = 27.5
A0_SHAR... | en | 0.878152 | #Default volume for Notes # Notes that can be called on, where C4 is middle C Initializes environment to play pygame noises # pygame.init() # pm.init() #Only works for non-Windows? #TODO Research this further to confirm Plays a sound of a given frequency [note] in Hertz for duration [time] in seconds at a particular... | 2.320251 | 2 |
venv/Lib/site-packages/ipykernel/inprocess/tests/test_kernel.py | itsAbdulKhadar/Machine-Learning-with-Streamlit | 5 | 6627480 | <filename>venv/Lib/site-packages/ipykernel/inprocess/tests/test_kernel.py
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import StringIO
import sys
import unittest
import pytest
import tornado
from ipykernel.inprocess.blocking import BlockingInProcessKer... | <filename>venv/Lib/site-packages/ipykernel/inprocess/tests/test_kernel.py
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from io import StringIO
import sys
import unittest
import pytest
import tornado
from ipykernel.inprocess.blocking import BlockingInProcessKer... | en | 0.780438 | # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. set default asyncio policy to be compatible with tornado Tornado 6 (at least) is not compatible with the default asyncio implementation on Windows Pick the older SelectorEventLoopPolicy on Windows if t... | 1.792866 | 2 |
src/sql_table.py | rocfelix/datascience_unittest | 0 | 6627481 | <filename>src/sql_table.py<gh_stars>0
from typing import Any, Union, Dict
import pandas as pd
import sqlalchemy
from sqlalchemy.orm import sessionmaker
class DummySqlDB():
"""MS SQL Server connection class"""
def __init__(self):
self.engine = self._create_engine()
self.session_maker = session... | <filename>src/sql_table.py<gh_stars>0
from typing import Any, Union, Dict
import pandas as pd
import sqlalchemy
from sqlalchemy.orm import sessionmaker
class DummySqlDB():
"""MS SQL Server connection class"""
def __init__(self):
self.engine = self._create_engine()
self.session_maker = session... | en | 0.62411 | MS SQL Server connection class Create SQLAlchemy engine | 2.84347 | 3 |
23_EntryNodeInListLoop/EntryNodeInListLoop.py | DevRoss/CodingInterviewChinese2 | 1 | 6627482 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by Ross on 19-1-15
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def count_node(p: ListNode):
p_slow = p
p_fast = p
c = 0
while True:
p_slow = p_slow.next
p_fast = p_fast.next.next
... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by Ross on 19-1-15
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def count_node(p: ListNode):
p_slow = p
p_fast = p
c = 0
while True:
p_slow = p_slow.next
p_fast = p_fast.next.next
... | zh | 0.393188 | #!/usr/bin/python3 # -*- coding: utf-8 -*- # Created by Ross on 19-1-15 # 判断有没有环 # 有环 # 前面的指针向前走num_node步 | 3.738836 | 4 |
app.py | doraqmon/DSCI-532_gr202_dashboard | 2 | 6627483 | <reponame>doraqmon/DSCI-532_gr202_dashboard<filename>app.py
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import altair as alt
import pandas as pd
import geopandas as gpd
import json
import dash_core_components as dcc
from helpers import *... | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import altair as alt
import pandas as pd
import geopandas as gpd
import json
import dash_core_components as dcc
from helpers import *
alt.data_transformers.disable_max_rows()
# alt.data_transf... | en | 0.612516 | # alt.data_transformers.enable('json') #alt.data_transformers.enable('data_server') # Import boston crimes # filter for needed columns # map district to neighbourhoods # filter out incomplete data from 1st and last month # register the custom theme under a chosen name # enable the newly registered theme # for dictionar... | 2.579844 | 3 |
pymc/examples/gp/more_examples/Geostats/getdata.py | matthew-brett/pymc | 5 | 6627484 | from numpy import *
# Download datafile
import urllib
urllib.urlretrieve('http://www.ai-geostats.org/fileadmin/Documents/Data/walker_01.dat',filename='walker_01.dat')
# Whhether to thin dataset; definitely thin it if you're running this example on your laptop!
thin = False
l = file('walker_01.dat').read().splitline... | from numpy import *
# Download datafile
import urllib
urllib.urlretrieve('http://www.ai-geostats.org/fileadmin/Documents/Data/walker_01.dat',filename='walker_01.dat')
# Whhether to thin dataset; definitely thin it if you're running this example on your laptop!
thin = False
l = file('walker_01.dat').read().splitline... | en | 0.756763 | # Download datafile # Whhether to thin dataset; definitely thin it if you're running this example on your laptop! | 2.819721 | 3 |
python/8kyu/classic_hello_world.py | Sigmanificient/codewars | 3 | 6627485 | """Kata url: https://www.codewars.com/kata/57036f007fd72e3b77000023."""
class Solution:
@staticmethod
def main():
print("Hello World!")
| """Kata url: https://www.codewars.com/kata/57036f007fd72e3b77000023."""
class Solution:
@staticmethod
def main():
print("Hello World!")
| en | 0.431958 | Kata url: https://www.codewars.com/kata/57036f007fd72e3b77000023. | 2.575906 | 3 |
tensorflow/python/data/experimental/kernel_tests/serialization/tf_record_dataset_serialization_test.py | MathMachado/tensorflow | 848 | 6627486 | <filename>tensorflow/python/data/experimental/kernel_tests/serialization/tf_record_dataset_serialization_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ... | <filename>tensorflow/python/data/experimental/kernel_tests/serialization/tf_record_dataset_serialization_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ... | en | 0.777158 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.060523 | 2 |
src/agents/td3/td3_utils.py | LeRyc/Robust-Robotic-Manipulation | 1 | 6627487 | <filename>src/agents/td3/td3_utils.py
import numpy as np
import torch
import torch.nn as nn
from src.agents.agent_commons import create_nn_layer
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action, actor_layer):
super(Actor, self).__init__()
actor_layer[0]["n_neurons"][0] = state_... | <filename>src/agents/td3/td3_utils.py
import numpy as np
import torch
import torch.nn as nn
from src.agents.agent_commons import create_nn_layer
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action, actor_layer):
super(Actor, self).__init__()
actor_layer[0]["n_neurons"][0] = state_... | en | 0.860792 | # Q1 architecture # Q2 architecture | 2.615864 | 3 |
tests/models.py | Django-Stack-Backend/Django-backend-React-frontend | 1 | 6627488 | from django.db import models
class Person(models.Model):
...
| from django.db import models
class Person(models.Model):
...
| none | 1 | 1.628768 | 2 | |
code/UI/OpenAPI/python-flask-server/swagger_server/__main__.py | dkoslicki/NCATS | 2 | 6627489 | #!/usr/bin/env python3
import connexion
from .encoder import JSONEncoder
if __name__ == '__main__':
app = connexion.App(__name__, specification_dir='./swagger/')
app.app.json_encoder = JSONEncoder
app.add_api('swagger.yaml', arguments={'title': 'Proof-of-concept OpenAPI front end for RTX.'})
app.run(... | #!/usr/bin/env python3
import connexion
from .encoder import JSONEncoder
if __name__ == '__main__':
app = connexion.App(__name__, specification_dir='./swagger/')
app.app.json_encoder = JSONEncoder
app.add_api('swagger.yaml', arguments={'title': 'Proof-of-concept OpenAPI front end for RTX.'})
app.run(... | fr | 0.221828 | #!/usr/bin/env python3 | 1.775474 | 2 |
tests/test_subscribers_manager.py | matan1008/srsran-controller | 0 | 6627490 | from contextlib import contextmanager
import pytest
from srsran_controller.configuration import config
from srsran_controller.subscribers_manager import SubscribersManager, Subscriber
@contextmanager
def change_users_db(new_users_db):
old_users = config.users_db
config.users_db = new_users_db
try:
... | from contextlib import contextmanager
import pytest
from srsran_controller.configuration import config
from srsran_controller.subscribers_manager import SubscribersManager, Subscriber
@contextmanager
def change_users_db(new_users_db):
old_users = config.users_db
config.users_db = new_users_db
try:
... | none | 1 | 2.113489 | 2 | |
core/domain/search_services_test.py | jlau323/oppia | 2 | 6627491 | <filename>core/domain/search_services_test.py
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | <filename>core/domain/search_services_test.py
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | en | 0.779759 | # coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi... | 1.944172 | 2 |
lectures/binary-search/guess-number.py | syedakainat3/youtube | 2,605 | 6627492 | # Guess Number Higher or Lower, https://leetcode.com/explore/learn/card/binary-search/125/template-i/951/
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
# def guess(num):
class Solution(object):
def guessNumber(... | # Guess Number Higher or Lower, https://leetcode.com/explore/learn/card/binary-search/125/template-i/951/
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
# def guess(num):
class Solution(object):
def guessNumber(... | en | 0.850522 | # Guess Number Higher or Lower, https://leetcode.com/explore/learn/card/binary-search/125/template-i/951/ # The guess API is already defined for you. # @param num, your guess # @return -1 if my number is lower, 1 if my number is higher, otherwise return 0 # def guess(num): # let's remember this value not to repeat the ... | 3.746372 | 4 |
src/app.py | ljw9609/NMT-FCONV | 0 | 6627493 | from flask import request, jsonify, make_response
from src import app
from fairseq.models.fconv import FConvModel
import os
PATH = os.path.join(os.path.dirname(__file__), '../FCONV/model')
zh2en = FConvModel.from_pretrained(
PATH,
checkpoint_file='model_zh2en.pt',
data_name_or_path=PATH,
tokenizer='m... | from flask import request, jsonify, make_response
from src import app
from fairseq.models.fconv import FConvModel
import os
PATH = os.path.join(os.path.dirname(__file__), '../FCONV/model')
zh2en = FConvModel.from_pretrained(
PATH,
checkpoint_file='model_zh2en.pt',
data_name_or_path=PATH,
tokenizer='m... | ar | 0.087438 | # t_text = en2zh.translate(s_text) # t_text = zh2en.translate(s_text) | 2.427755 | 2 |
tests/test_conf.py | WorkInProgress-Development/theplease | 0 | 6627494 | <gh_stars>0
import pytest
import six
import os
from mock import Mock
from theplease import const
@pytest.fixture
def load_source(mocker):
return mocker.patch('theplease.conf.load_source')
def test_settings_defaults(load_source, settings):
load_source.return_value = object()
settings.init()
for key, ... | import pytest
import six
import os
from mock import Mock
from theplease import const
@pytest.fixture
def load_source(mocker):
return mocker.patch('theplease.conf.load_source')
def test_settings_defaults(load_source, settings):
load_source.return_value = object()
settings.init()
for key, val in const... | none | 1 | 2.067362 | 2 | |
users/migrations/0003_auto_20180630_0145.py | tat3/djitter | 4 | 6627495 | <reponame>tat3/djitter<filename>users/migrations/0003_auto_20180630_0145.py
# Generated by Django 2.0.5 on 2018-06-30 01:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_user_nickname'),
]
operations = [
migrations.Alter... | # Generated by Django 2.0.5 on 2018-06-30 01:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_user_nickname'),
]
operations = [
migrations.AlterField(
model_name='user',
name='nickname',
... | en | 0.791483 | # Generated by Django 2.0.5 on 2018-06-30 01:45 | 1.631697 | 2 |
lstm/ilab/metrics_np.py | ucrscholar/HandWashNet | 1 | 6627496 | import numpy as np
def iou_np(y_true, y_pred, smooth=1.):
intersection = y_true * y_pred
union = y_true + y_pred
return np.sum(intersection + smooth) / np.sum(union - intersection + smooth)
def iou_thresholded_np(y_true, y_pred, threshold=0.5, smooth=1.):
y_pred_pos = (y_pred > threshold) * 1.0
... | import numpy as np
def iou_np(y_true, y_pred, smooth=1.):
intersection = y_true * y_pred
union = y_true + y_pred
return np.sum(intersection + smooth) / np.sum(union - intersection + smooth)
def iou_thresholded_np(y_true, y_pred, threshold=0.5, smooth=1.):
y_pred_pos = (y_pred > threshold) * 1.0
... | none | 1 | 2.477428 | 2 | |
python/p1a/main.py | AoEiuV020/codeforces | 0 | 6627497 | line = input()
nums = line.split(' ')
w = int(nums[0])
h = int(nums[1])
a = int(nums[2])
wc = (w + a - 1) // a
hc = (h + a - 1) // a
ret = wc * hc
print(ret)
| line = input()
nums = line.split(' ')
w = int(nums[0])
h = int(nums[1])
a = int(nums[2])
wc = (w + a - 1) // a
hc = (h + a - 1) // a
ret = wc * hc
print(ret)
| none | 1 | 3.139935 | 3 | |
bokeh/embed/tests/test_elements.py | kevin1kevin1k/bokeh | 12 | 6627498 | <reponame>kevin1kevin1k/bokeh
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------... | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | en | 0.129891 | #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------... | 1.441273 | 1 |
crawling_scraping/beautiful_soup/scrape_by_bs4.py | litteletips/crawling_scraping-scrapy_tool | 0 | 6627499 | <gh_stars>0
# Beautiful Soup4を使ったスクレイピング
# HTMLから書籍のURLとタイトルを抽出できる
# 内部のパーサーを目的に応じて変えられる。(html.parser,lxml,lxml-xml,html5lib)
# 実行方法
# python scrape_by_bs4.py
from urllib.parse import urljoin
from bs4 import BeautifulSoup
# HTMLファイルを読み込んでBeautifulSoupオブジェクトを得る。
with open('dp.html') as f:
soup = BeautifulSoup(f, ... | # Beautiful Soup4を使ったスクレイピング
# HTMLから書籍のURLとタイトルを抽出できる
# 内部のパーサーを目的に応じて変えられる。(html.parser,lxml,lxml-xml,html5lib)
# 実行方法
# python scrape_by_bs4.py
from urllib.parse import urljoin
from bs4 import BeautifulSoup
# HTMLファイルを読み込んでBeautifulSoupオブジェクトを得る。
with open('dp.html') as f:
soup = BeautifulSoup(f, 'html.parser... | ja | 0.999716 | # Beautiful Soup4を使ったスクレイピング # HTMLから書籍のURLとタイトルを抽出できる # 内部のパーサーを目的に応じて変えられる。(html.parser,lxml,lxml-xml,html5lib) # 実行方法 # python scrape_by_bs4.py # HTMLファイルを読み込んでBeautifulSoupオブジェクトを得る。 # select()メソッドで、セレクターに該当するa要素のリストを取得して、個々のa要素に対して処理を行う。 # a要素のhref属性から書籍のURLを取得する。 # 書籍のタイトルは itemprop="name" という属性を持つp要素から取得する。 # wb... | 3.616592 | 4 |
GUI/NumericalV.py | RECIEM/Ballistica | 2 | 6627500 | # Red Ciudadana de Estaciones Meteorologicas
#
# Copyright @ 2021
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
import matplotlib
import tkinter as tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
plt.rcParams... | # Red Ciudadana de Estaciones Meteorologicas
#
# Copyright @ 2021
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
import matplotlib
import tkinter as tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
plt.rcParams... | en | 0.525514 | # Red Ciudadana de Estaciones Meteorologicas # # Copyright @ 2021 # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # Top level panel structure # Left and right panels # Controls grid for upper left pannel # Control for angle # Control for drag # Control for velocity # Controls grid for upper left pannel # Butt... | 3.012111 | 3 |
packages/nodejs-lts.py | zpcc/mpkg-pkgs | 1 | 6627501 | <reponame>zpcc/mpkg-pkgs
import time
from mpkg.common import Soft
from mpkg.utils import Search
class Package(Soft):
ID = 'nodejs-lts'
def _prepare(self):
data = self.data
arch = {'32bit': 'https://nodejs.org/dist/v{ver}/node-v{ver}-x86.msi',
'64bit': 'https://nodejs.org/dist... | import time
from mpkg.common import Soft
from mpkg.utils import Search
class Package(Soft):
ID = 'nodejs-lts'
def _prepare(self):
data = self.data
arch = {'32bit': 'https://nodejs.org/dist/v{ver}/node-v{ver}-x86.msi',
'64bit': 'https://nodejs.org/dist/v{ver}/node-v{ver}-x64.m... | none | 1 | 2.389354 | 2 | |
lnt/lnt/report/draft_salary_register/draft_salary_register.py | vhrspvl/lnt | 0 | 6627502 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
salary_slips = get_salary_sli... | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
salary_slips = get_salary_sli... | en | 0.597102 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt columns = [ _("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120", _("Department") + ":Link/Depa... | 2.282491 | 2 |
Code/Bogoliubov_Kitaev.py | PatrickHuembeli/Adversarial-Domain-Adaptation-for-Identifying-Phase-Transitions | 19 | 6627503 | <gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File to generate Input Data for Kitaev model.
Credits:
Hamiltonian from https://topocondmat.org/w1_topointro/1D.html
Bogoliubov according to
http://iopscience.iop.org/article/10.1088/0953-8984/25/47/475304
Author: <NAME>
"""
import sys
i... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File to generate Input Data for Kitaev model.
Credits:
Hamiltonian from https://topocondmat.org/w1_topointro/1D.html
Bogoliubov according to
http://iopscience.iop.org/article/10.1088/0953-8984/25/47/475304
Author: <NAME>
"""
import sys
import numpy as np... | en | 0.590507 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- File to generate Input Data for Kitaev model.
Credits:
Hamiltonian from https://topocondmat.org/w1_topointro/1D.html
Bogoliubov according to
http://iopscience.iop.org/article/10.1088/0953-8984/25/47/475304
Author: <NAME> # For simplicity we set t = delta # diagona... | 2.701599 | 3 |
tensorflow_federated/python/aggregators/mean.py | alessiomora/federated | 1,918 | 6627504 | <reponame>alessiomora/federated<filename>tensorflow_federated/python/aggregators/mean.py
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | # Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.80636 | # Copyright 2020, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 2.196421 | 2 |
myCode.py | shyshin/Sushi-Game-miniclip-bot | 0 | 6627505 | <reponame>shyshin/Sushi-Game-miniclip-bot
import win32con,win32api
import time as time
from PIL import ImageGrab as Image
from PIL import ImageOps
import numpy as np
import os
foodavail={
'shrimp':5,
'rice':10,
'nori':10,
'fish':10,
'salmon':5,
'unagi':5
}
sushitype={
... | import win32con,win32api
import time as time
from PIL import ImageGrab as Image
from PIL import ImageOps
import numpy as np
import os
foodavail={
'shrimp':5,
'rice':10,
'nori':10,
'fish':10,
'salmon':5,
'unagi':5
}
sushitype={
'gun':1770,
'cal':2100,
... | fa | 0.089985 | #---------------------------------- #---------------------------------- #---------------------------------- # im.save(os.getcwd() + '\\seat_one_'+str(int(time.time()))+'.png','PNG') # im.save(os.getcwd() + '\\seat_two_'+str(int(time.time()))+'.png','PNG') # im.save(os.getcwd() + '\\seat_third_'+str(int(time.time()))... | 2.343906 | 2 |
salt/modules/win_network.py | mitsuhiko/salt | 4 | 6627506 | '''
Module for gathering and managing network information
'''
import sys
from string import ascii_letters, digits
from salt.utils.interfaces import *
from salt.utils.socket_util import *
__outputter__ = {
'dig': 'txt',
'ping': 'txt',
'netstat': 'txt',
}
def __virtual__():
'''
Only works on... | '''
Module for gathering and managing network information
'''
import sys
from string import ascii_letters, digits
from salt.utils.interfaces import *
from salt.utils.socket_util import *
__outputter__ = {
'dig': 'txt',
'ping': 'txt',
'netstat': 'txt',
}
def __virtual__():
'''
Only works on... | en | 0.748015 | Module for gathering and managing network information Only works on Windows systems Sanitize host string. Performs a ping to a host CLI Example:: salt '*' network.ping archlinux.org Return information on open ports and states CLI Example:: salt '*' network.netstat Performs a traceroute to a ... | 3.03038 | 3 |
test_reporter.py | iroth/pytunes-reporter | 0 | 6627507 | import pytest
import responses
from faker import Factory
from requests.exceptions import HTTPError
# library to test
import reporter
sales_url = 'https://reportingitc-reporter.apple.com/reportservice/sales/v1'
financial_url = 'https://reportingitc-reporter.apple.com/reportservice/finance/v1'
@pytest.fixture(scope='... | import pytest
import responses
from faker import Factory
from requests.exceptions import HTTPError
# library to test
import reporter
sales_url = 'https://reportingitc-reporter.apple.com/reportservice/sales/v1'
financial_url = 'https://reportingitc-reporter.apple.com/reportservice/finance/v1'
@pytest.fixture(scope='... | en | 0.19746 | # library to test <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Vendors> {vendors} </Vendors> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <VendorsAndRegions> <Vendor> <Number>80012345</Number> <Region> <Code>US</Code> <Reports> <Report>F... | 2.288535 | 2 |
shorten.py | jasonshaw/learningpython | 0 | 6627508 | # 1.长链接转换为短链接核心就是进制转换
# 2.十进制数转为62进制( 0~9 + A~Z + a~z )共62个字符
# 3.假如允许转换的10进制数范围为 10 000 000~ 99 999 999 (唯一,相当于数据库主键)每一个数字对应一个长链接,再转为62进制数
# 4.浏览器解析时,现将短链接(62进制数)转换成 10进制数 --- > 再找到对应的长链接,最后解析
# 数字转62进制
def convert(num):
global all_chars
all_chars = '0123456789ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuv... | # 1.长链接转换为短链接核心就是进制转换
# 2.十进制数转为62进制( 0~9 + A~Z + a~z )共62个字符
# 3.假如允许转换的10进制数范围为 10 000 000~ 99 999 999 (唯一,相当于数据库主键)每一个数字对应一个长链接,再转为62进制数
# 4.浏览器解析时,现将短链接(62进制数)转换成 10进制数 --- > 再找到对应的长链接,最后解析
# 数字转62进制
def convert(num):
global all_chars
all_chars = '0123456789ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuv... | zh | 0.924494 | # 1.长链接转换为短链接核心就是进制转换 # 2.十进制数转为62进制( 0~9 + A~Z + a~z )共62个字符 # 3.假如允许转换的10进制数范围为 10 000 000~ 99 999 999 (唯一,相当于数据库主键)每一个数字对应一个长链接,再转为62进制数 # 4.浏览器解析时,现将短链接(62进制数)转换成 10进制数 --- > 再找到对应的长链接,最后解析 # 数字转62进制 #$%&_-' # 拿到对应的下标取得mod进制数,并插入列表0号位 # 例:12 000 000 转为mod进制数为 oLkO | 3.098263 | 3 |
monai/apps/utils.py | Scitator/MONAI | 1 | 6627509 | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | en | 0.73788 | # Copyright 2020 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s... | 2.208018 | 2 |
problem_sets/ps_08-2020Fall/problem_set_08_solution.py | arwhyte/SI506-practice | 12 | 6627510 | # START PROBLEM SET 08
print('Problem set 08 \n')
# SETUP
import csv
state2state_id = {
'Alabama' : 'AL',
'Alaska' : 'AK',
'Arizona' : 'AZ',
'Arkansas' : 'AR',
'California' : 'CA',
'Colorado' : 'CO',
'Connecticut' : 'CT',
'Delaware' : 'DE',
'Florida' : 'FL',
'Georgia' : 'GA',
... | # START PROBLEM SET 08
print('Problem set 08 \n')
# SETUP
import csv
state2state_id = {
'Alabama' : 'AL',
'Alaska' : 'AK',
'Arizona' : 'AZ',
'Arkansas' : 'AR',
'California' : 'CA',
'Colorado' : 'CO',
'Connecticut' : 'CT',
'Delaware' : 'DE',
'Florida' : 'FL',
'Georgia' : 'GA',
... | en | 0.785453 | # START PROBLEM SET 08 # SETUP # END SETUP ### PROBLEM 1.1 Returns a list of lists where each item (list) is formed from the data split by tab. Parameters: filepath (str): a filepath that includes a filename with its extension Returns: list: a list of lists that contain states and total number... | 3.200236 | 3 |
Classes and Objects/class1.py | artuguen28/Python_bible_intermediates | 0 | 6627511 | # Creating classes
class Car:
amount_cars = 0
# __init__ is the constructor
# self is a mandatory parameter
def __init__(self, manufacturer, model, hp):
self.manufacturer = manufacturer
self.model = model
self.hp = hp
Car.amount_cars += 1
def print_info(self):
... | # Creating classes
class Car:
amount_cars = 0
# __init__ is the constructor
# self is a mandatory parameter
def __init__(self, manufacturer, model, hp):
self.manufacturer = manufacturer
self.model = model
self.hp = hp
Car.amount_cars += 1
def print_info(self):
... | en | 0.583581 | # Creating classes # __init__ is the constructor # self is a mandatory parameter # def__del__(self): # print("Object gets deleted!") # Car.amount_cars -= 1 # Hidden Atributes # Works # Inheritance # The Programmer class inherits the and functions of Person class # Operator Overloading | 4.403006 | 4 |
site/populate.py | annaelde/wall-app | 1 | 6627512 | <reponame>annaelde/wall-app<gh_stars>1-10
"""
Populates the database for testing and development.
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.dev")
application = get_wsgi_application()
from users.models import User
from posts.models import Po... | """
Populates the database for testing and development.
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.dev")
application = get_wsgi_application()
from users.models import User
from posts.models import Post
if __name__ == '__main__':
post =... | en | 0.886914 | Populates the database for testing and development. # Create five posts | 2.343755 | 2 |
tests/gptj/gptj_test_3d_training_with_fusion.py | sooftware/oslo | 0 | 6627513 | # Copyright 2021 TUNiB Inc.
import os
import random
import numpy
import torch
import torch.distributed as dist
from datasets import load_dataset
from torch.optim import Adam
from torch.utils.data import DataLoader
from transformers import GPT2Tokenizer
from oslo.models.gptj.modeling_gptj import (
GPTJForCausalLM... | # Copyright 2021 TUNiB Inc.
import os
import random
import numpy
import torch
import torch.distributed as dist
from datasets import load_dataset
from torch.optim import Adam
from torch.utils.data import DataLoader
from transformers import GPT2Tokenizer
from oslo.models.gptj.modeling_gptj import (
GPTJForCausalLM... | en | 0.652894 | # Copyright 2021 TUNiB Inc. For debugging For debugging For debugging | 1.991479 | 2 |
qafan/checkheaders.py | quatrope/qafan | 0 | 6627514 | <filename>qafan/checkheaders.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2022, QuatroPe
# All rights reserved.
# =============================================================================
# DOCS
# =================... | <filename>qafan/checkheaders.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised))
# Copyright (c) 2022, QuatroPe
# All rights reserved.
# =============================================================================
# DOCS
# =================... | en | 0.391613 | #!/usr/bin/env python # -*- coding: utf-8 -*- # License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised)) # Copyright (c) 2022, QuatroPe # All rights reserved. # ============================================================================= # DOCS # ===================================================... | 1.581017 | 2 |
pysc2/agents/myAgent/myAgent_11/net/bicnet_for_level_2/bicnet.py | Hotpotfish/pysc2 | 0 | 6627515 | import tensorflow as tf
from pysc2.agents.myAgent.myAgent_11.config import config
import tensorflow.contrib.slim as slim
class bicnet(object):
def __init__(self, mu, sigma, learning_rate, action_dim, statedim, agents_number, enemy_number, name): # 初始化
# 神经网络参数
self.mu = mu
self.sigma = s... | import tensorflow as tf
from pysc2.agents.myAgent.myAgent_11.config import config
import tensorflow.contrib.slim as slim
class bicnet(object):
def __init__(self, mu, sigma, learning_rate, action_dim, statedim, agents_number, enemy_number, name): # 初始化
# 神经网络参数
self.mu = mu
self.sigma = s... | en | 0.244769 | # 初始化 # 神经网络参数 # 动作维度数,动作参数维度数,状态维度数 # networks parameters # target net replacement # maximize the q # s # 全局状态 # s_ # 全局状态 # 环境和智能体本地的共同观察 # (self.agents_number,batch_size,obs_add_dim) # fc1 = slim.fully_connected(bicnet_outputs[i], 30, scope='full_connected1' + "_" + str(i)) # (agents_number, batch_size, action_dim) ... | 2.417525 | 2 |
gitgud/levels/rampup/__init__.py | Ishan1742/git-gud | 0 | 6627516 | <gh_stars>0
import pkg_resources
from gitgud.levels.util import BasicChallenge
from gitgud.levels.util import Level
level = Level(
'rampup',
[
BasicChallenge('detaching', pkg_resources.resource_filename(__name__, '_detaching/')),
BasicChallenge('relrefs1', pkg_resources.resource_filename(__nam... | import pkg_resources
from gitgud.levels.util import BasicChallenge
from gitgud.levels.util import Level
level = Level(
'rampup',
[
BasicChallenge('detaching', pkg_resources.resource_filename(__name__, '_detaching/')),
BasicChallenge('relrefs1', pkg_resources.resource_filename(__name__, '_relre... | none | 1 | 1.780689 | 2 | |
OpenCV Egitim Dosyalari/ch6/maskeleme.py | HisarCS/PiWarsTurkey-Library-Folders | 3 | 6627517 | <reponame>HisarCS/PiWarsTurkey-Library-Folders<filename>OpenCV Egitim Dosyalari/ch6/maskeleme.py
import cv2
import os
import numpy as np
logo = cv2.imread(os.path.abspath('PiWarsTurkeyLogo.png'))
cv2.imshow("Logo Asil", logo)
dikdortgen = np.zeros((logo.shape[0], logo.shape[1]), dtype = "uint8")
cv2.rectangle(dikdo... | Egitim Dosyalari/ch6/maskeleme.py
import cv2
import os
import numpy as np
logo = cv2.imread(os.path.abspath('PiWarsTurkeyLogo.png'))
cv2.imshow("Logo Asil", logo)
dikdortgen = np.zeros((logo.shape[0], logo.shape[1]), dtype = "uint8")
cv2.rectangle(dikdortgen, (0, 0), (220, 387), 255, -1)
cv2.imshow("dikdortgen", di... | none | 1 | 3.0276 | 3 | |
src/models/caps_activate_fn.py | LeanderLXZ/oracle-recognition | 1 | 6627518 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class ActivationFunc(object):
@staticmethod
def squash(x, batch_size, epsilon):
"""Squashing function
Args:
x: A tensor with shape: (batch_size, num_caps, vec_dim, ... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class ActivationFunc(object):
@staticmethod
def squash(x, batch_size, epsilon):
"""Squashing function
Args:
x: A tensor with shape: (batch_size, num_caps, vec_dim, ... | en | 0.752298 | Squashing function Args: x: A tensor with shape: (batch_size, num_caps, vec_dim, 1). batch_size: Batch size epsilon: Add epsilon(a very small number) to zeros Returns: A tensor with the same shape as input tensor but squashed in 'vec_dim' dimension. # scalar_factor = tf.div(vec_s... | 2.774964 | 3 |
ai_api/__init__.py | sunshine-app/CodeAIBaidu | 3 | 6627519 | # -*- coding: utf-8 -*-
# @Time : 2019/4/25 9:27
# @Author : shine
# @File : __init__.py.py | # -*- coding: utf-8 -*-
# @Time : 2019/4/25 9:27
# @Author : shine
# @File : __init__.py.py | fr | 0.276762 | # -*- coding: utf-8 -*- # @Time : 2019/4/25 9:27 # @Author : shine # @File : __init__.py.py | 0.944474 | 1 |
decoders/misc/writer.py | necrose99/Dshell | 1 | 6627520 | '''
Created on Jan 13, 2012
@author: tparker
'''
import dshell
import dpkt
from output import PCAPWriter
class DshellDecoder(dshell.Decoder):
'''
session writer - chain to a decoder to end the chain if the decoder does not output session or packets on its own
if chained to a packet-based decoder, write... | '''
Created on Jan 13, 2012
@author: tparker
'''
import dshell
import dpkt
from output import PCAPWriter
class DshellDecoder(dshell.Decoder):
'''
session writer - chain to a decoder to end the chain if the decoder does not output session or packets on its own
if chained to a packet-based decoder, write... | en | 0.814954 | Created on Jan 13, 2012 @author: tparker session writer - chain to a decoder to end the chain if the decoder does not output session or packets on its own if chained to a packet-based decoder, writes all packets to pcap file, can be used to convert or concatenate files if chained to a connection-based decoder,... | 2.525476 | 3 |
stage/standard/test_sql_server_cdc_origin.py | streamsets/datacollector-tests | 14 | 6627521 | # Copyright 2020 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2020 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | en | 0.742677 | # Copyright 2020 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi... | 1.685212 | 2 |
hydrus/app.py | king-11/hydrus | 0 | 6627522 | """Main route for the application"""
import logging
from sqlalchemy import create_engine
from gevent.pywsgi import WSGIServer
from sqlalchemy.orm import sessionmaker
from hydrus.app_factory import app_factory
from hydrus.conf import (
HYDRUS_SERVER_URL, API_NAME, DB_URL, APIDOC_OBJ, PORT, DEBUG)
from hydrus.dat... | """Main route for the application"""
import logging
from sqlalchemy import create_engine
from gevent.pywsgi import WSGIServer
from sqlalchemy.orm import sessionmaker
from hydrus.app_factory import app_factory
from hydrus.conf import (
HYDRUS_SERVER_URL, API_NAME, DB_URL, APIDOC_OBJ, PORT, DEBUG)
from hydrus.dat... | en | 0.72093 | Main route for the application # TODO: loading the engine and creating the tables should be handled better # # Load ApiDoc with doc_maker # # Create a Hydrus app # # Nested context managers # # Use authentication for all requests # Set the API Documentation # Set HYDRUS_SERVER_URL # Set the Database session # this is r... | 2.169068 | 2 |
examples/virus/influenza_analysis.py | sys-bio/SBstoat | 0 | 6627523 | #!/usr/bin/env python
# coding: utf-8
# # Fitting Parameters for Influenza Data
# ## Overview
#
# This is a study of the Influenza data. The analysis provides plots of fits and parameter estimates. Two models are considered.
#
# ### Influenza Data (Influenza.csv)
#
# - 6 patients
# - Viral levels in log10(TCID50 /... | #!/usr/bin/env python
# coding: utf-8
# # Fitting Parameters for Influenza Data
# ## Overview
#
# This is a study of the Influenza data. The analysis provides plots of fits and parameter estimates. Two models are considered.
#
# ### Influenza Data (Influenza.csv)
#
# - 6 patients
# - Viral levels in log10(TCID50 /... | en | 0.697249 | #!/usr/bin/env python # coding: utf-8 # # Fitting Parameters for Influenza Data # ## Overview # # This is a study of the Influenza data. The analysis provides plots of fits and parameter estimates. Two models are considered. # # ### Influenza Data (Influenza.csv) # # - 6 patients # - Viral levels in log10(TCID50 / ml o... | 3.108148 | 3 |
powerline/bindings/qtile/widget.py | MrFishFinger/powerline | 11,435 | 6627524 | <gh_stars>1000+
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from libqtile.bar import CALCULATED
from libqtile.widget import TextBox
from powerline import Powerline
class QTilePowerline(Powerline):
def do_setup(self, obj):
obj.powerline = self... | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from libqtile.bar import CALCULATED
from libqtile.widget import TextBox
from powerline import Powerline
class QTilePowerline(Powerline):
def do_setup(self, obj):
obj.powerline = self
class Powerli... | en | 0.646527 | # vim:fileencoding=utf-8:noet # TODO Replace timeout argument with update_interval argument in next major # release. # QTile-0.9.1: no need to recreate layout or run timer_setup # TODO: Remove this at next major release | 2.237269 | 2 |
website_monitor/website_monitor.py | John2662/website_monitor | 0 | 6627525 | # -*- coding: utf-8 -*-
"""Main module."""
import copy
import datetime
import getopt
import json
import logging as log
import os
import re as reg_ex
import sys
import threading
import time
import requests
from website_monitor import db_utils
from .wm_exceptions import (
ConfigFileEmpty, ConfigFileInvalid, Requir... | # -*- coding: utf-8 -*-
"""Main module."""
import copy
import datetime
import getopt
import json
import logging as log
import os
import re as reg_ex
import sys
import threading
import time
import requests
from website_monitor import db_utils
from .wm_exceptions import (
ConfigFileEmpty, ConfigFileInvalid, Requir... | en | 0.708779 | # -*- coding: utf-8 -*- Main module. Represents a configuration object. Initialize a WebMonitorConfigObject instance. :param config_abs_path: String representing absolute path to configuration file :param check_period: Value representing the interval period between website statu... | 2.346437 | 2 |
ampy/cli.py | Cediddi/ampy | 1 | 6627526 | # Adafruit MicroPython Tool - Command Line Interface
# Author: <NAME>
# Copyright (c) 2016 Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including... | # Adafruit MicroPython Tool - Command Line Interface
# Author: <NAME>
# Copyright (c) 2016 Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including... | en | 0.849205 | # Adafruit MicroPython Tool - Command Line Interface # Author: <NAME> # Copyright (c) 2016 Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including... | 2.336526 | 2 |
kale/pipeline/video_domain_adapter.py | SheffieldAI/pykale | 0 | 6627527 | # =============================================================================
# Author: <NAME>, <EMAIL>
# <NAME>, <EMAIL> or <EMAIL>
# =============================================================================
"""Domain adaptation systems (pipelines) for video data, e.g., for action recognition.
Most are ... | # =============================================================================
# Author: <NAME>, <EMAIL>
# <NAME>, <EMAIL> or <EMAIL>
# =============================================================================
"""Domain adaptation systems (pipelines) for video data, e.g., for action recognition.
Most are ... | en | 0.740545 | # ============================================================================= # Author: <NAME>, <EMAIL> # <NAME>, <EMAIL> or <EMAIL> # ============================================================================= Domain adaptation systems (pipelines) for video data, e.g., for action recognition. Most are inhe... | 2.422904 | 2 |
train_lstm.py | yuangan/A2L | 0 | 6627528 | <reponame>yuangan/A2L
#!/usr/bin/env python3
#coding:utf-8
import os
import os.path as osp
import re
import sys
import yaml
import shutil
import numpy as np
import torch
import click
import warnings
warnings.simplefilter('ignore')
from functools import reduce
from munch import Munch
from meldataset import build_data... | #!/usr/bin/env python3
#coding:utf-8
import os
import os.path as osp
import re
import sys
import yaml
import shutil
import numpy as np
import torch
import click
import warnings
warnings.simplefilter('ignore')
from functools import reduce
from munch import Munch
from meldataset import build_dataloader
from optimizers... | en | 0.452456 | #!/usr/bin/env python3 #coding:utf-8 # # write logs # load data # load pretrained ASR model # load pretrained F0 model # build model # scheduler_params_dict['mapping_network']['max_lr'] = 2e-6 | 1.910425 | 2 |
Texture Maps/lbp3d.py | Gas-Helio/Trabalhando-com-imagens-3d | 1 | 6627529 | # -*- coding: utf-8 -*-
"""LBP3D.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1Y-EefNZliOPCzhaLFRu_43Gr0h2xalW3
"""
import numpy as np
def LBP_3D(img, v):
resul = np.zeros(img.shape)
imgZeros = np.zeros((img.shape[0]+2, img.shape[1]+2... | # -*- coding: utf-8 -*-
"""LBP3D.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1Y-EefNZliOPCzhaLFRu_43Gr0h2xalW3
"""
import numpy as np
def LBP_3D(img, v):
resul = np.zeros(img.shape)
imgZeros = np.zeros((img.shape[0]+2, img.shape[1]+2... | en | 0.83228 | # -*- coding: utf-8 -*- LBP3D.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Y-EefNZliOPCzhaLFRu_43Gr0h2xalW3 Exemple ``` # LBP_3D(image, lbp_v1) ``` | 2.703115 | 3 |
streamingApm.py | prelert/engine-python | 36 | 6627530 | #!/usr/bin/env python
############################################################################
# #
# Copyright 2014 Prelert Ltd #
# ... | #!/usr/bin/env python
############################################################################
# #
# Copyright 2014 Prelert Ltd #
# ... | en | 0.780786 | #!/usr/bin/env python ############################################################################ # # # Copyright 2014 Prelert Ltd # # ... | 1.92707 | 2 |
cfnlp/faiss/__init__.py | zhangyuo/cf-nlp-py | 0 | 6627531 | <gh_stars>0
#!/usr/bin/env python
# coding:utf-8
"""
# @Time : 2020-07-27 14:28
# @Author : Zhangyu
# @Email : <EMAIL>
# @File : __init__.py.py
# @Software : PyCharm
# @Desc :
"""
| #!/usr/bin/env python
# coding:utf-8
"""
# @Time : 2020-07-27 14:28
# @Author : Zhangyu
# @Email : <EMAIL>
# @File : __init__.py.py
# @Software : PyCharm
# @Desc :
""" | fr | 0.303593 | #!/usr/bin/env python # coding:utf-8 # @Time : 2020-07-27 14:28 # @Author : Zhangyu # @Email : <EMAIL> # @File : __init__.py.py # @Software : PyCharm # @Desc : | 1.041039 | 1 |
openpecha/catalog/storage.py | ta4tsering/openpecha-toolkit | 1 | 6627532 | import base64
import logging
from abc import ABC, abstractclassmethod
import requests
from github import Github
from .config import GITHUB_BUCKET_CONFIG
from .utils import create_pecha_id
class Bucket(ABC):
"""A class representing a Bucket on Cloud Storage."""
def __init__(self, name, config):
self... | import base64
import logging
from abc import ABC, abstractclassmethod
import requests
from github import Github
from .config import GITHUB_BUCKET_CONFIG
from .utils import create_pecha_id
class Bucket(ABC):
"""A class representing a Bucket on Cloud Storage."""
def __init__(self, name, config):
self... | en | 0.51916 | A class representing a Bucket on Cloud Storage. Return github org object Get the blob content from the url provided in parameter Decode the base64 encoded blob into UTF-8 | 2.718334 | 3 |
encode.py | mueslimak3r/mystery-meme | 0 | 6627533 | <filename>encode.py
import sys, getopt
import fixedint
from PIL import Image
from pathlib import Path
from generatepattern import generate_pattern
'''
encode_bits
encodes two bits from the source text into the LSBs of the source image's green and blue channels
'''
def encode_bits(g, b, image_pos, input_data, inpu... | <filename>encode.py
import sys, getopt
import fixedint
from PIL import Image
from pathlib import Path
from generatepattern import generate_pattern
'''
encode_bits
encodes two bits from the source text into the LSBs of the source image's green and blue channels
'''
def encode_bits(g, b, image_pos, input_data, inpu... | en | 0.766578 | encode_bits encodes two bits from the source text into the LSBs of the source image's green and blue channels # # get g and b byte to modify # get byte from input data to modify # # bitshift the two bits from the input data to mask the least significant bits in the g and b pixel bytes # flip the bit on or off if neede... | 3.567049 | 4 |
tests/test__mets_maker.py | StateArchivesOfNorthCarolina/tomes_metadata | 0 | 6627534 | #!/usr/bin/env python3
# import modules.
import sys; sys.path.append("..")
import logging
import plac
import tempfile
import unittest
from datetime import datetime
from tomes_packager.lib.mets_maker import *
# enable logging.
logging.basicConfig(level=logging.DEBUG)
class Test_MetsMaker(unittest.TestCase):
... | #!/usr/bin/env python3
# import modules.
import sys; sys.path.append("..")
import logging
import plac
import tempfile
import unittest
from datetime import datetime
from tomes_packager.lib.mets_maker import *
# enable logging.
logging.basicConfig(level=logging.DEBUG)
class Test_MetsMaker(unittest.TestCase):
... | en | 0.665045 | #!/usr/bin/env python3 # import modules. # enable logging. # set attributes. Is a rendered METS valid? # make temporary file, save the filename, then delete the file. # write a temporary METS file. # see if METS is valid. # CLI. # create and self-validate METS file. | 2.460676 | 2 |
MHD/FEniCS/CGns/NS1.py | wathen/PhD | 3 | 6627535 | #!/usr/bin/python
# import petsc4py
# import sys
# petsc4py.init(sys.argv)
# from petsc4py import PETSc
# from MatrixOperations import *
from dolfin import *
import numpy as np
import matplotlib.pylab as plt
import os
import scipy.io
from PyTrilinos import Epetra, EpetraExt, AztecOO, ML, Amesos
from scipy2Trilinos imp... | #!/usr/bin/python
# import petsc4py
# import sys
# petsc4py.init(sys.argv)
# from petsc4py import PETSc
# from MatrixOperations import *
from dolfin import *
import numpy as np
import matplotlib.pylab as plt
import os
import scipy.io
from PyTrilinos import Epetra, EpetraExt, AztecOO, ML, Amesos
from scipy2Trilinos imp... | en | 0.291922 | #!/usr/bin/python # import petsc4py # import sys # petsc4py.init(sys.argv) # from petsc4py import PETSc # from MatrixOperations import * # plt.spy(Aublas1) # if (Nb < 1000): # plt.show() #MO.SwapBackend('epetra') #os.system("echo $PATH") # Create mesh and define function space # nn = 32 # mesh = UnitSquareMesh(16,16) #... | 2.296959 | 2 |
src/db_writer.py | DesignBuilderSoftware/db-temperature-distribution | 0 | 6627536 | """Define functions to writer parsed tables to various formats."""
import csv
from pathlib import Path
from typing import List
from db_table import DbTable
class DbWriter:
"""Writes table data to filesystem."""
@classmethod
def write_table(cls, table: DbTable, directory: Path) -> Path:
"""
... | """Define functions to writer parsed tables to various formats."""
import csv
from pathlib import Path
from typing import List
from db_table import DbTable
class DbWriter:
"""Writes table data to filesystem."""
@classmethod
def write_table(cls, table: DbTable, directory: Path) -> Path:
"""
... | en | 0.633275 | Define functions to writer parsed tables to various formats. Writes table data to filesystem. Write table to given directory, table name is used as file name. Arguments --------- table : DbTable Parsed DbTable. directory : Path A path to directory to place output... | 3.830534 | 4 |
onlinepayments/sdk/log/log_message.py | wl-online-payments-direct/sdk-python3 | 0 | 6627537 | from abc import ABC, abstractmethod
from onlinepayments.sdk.log.logging_util import LoggingUtil
class LogMessage(ABC):
"""
A utility class to build log messages.
"""
__request_id = None
__headers = None
__body = None
__content_type = None
__header_list = None
def __init__(self, r... | from abc import ABC, abstractmethod
from onlinepayments.sdk.log.logging_util import LoggingUtil
class LogMessage(ABC):
"""
A utility class to build log messages.
"""
__request_id = None
__headers = None
__body = None
__content_type = None
__header_list = None
def __init__(self, r... | en | 0.75611 | A utility class to build log messages. | 2.775149 | 3 |
test/main.py | populationgenomics/analysis-runner | 0 | 6627538 | #!/usr/bin/env python3
"""A very simple batch that tests basic functionality."""
import hail as hl
hl.init()
| #!/usr/bin/env python3
"""A very simple batch that tests basic functionality."""
import hail as hl
hl.init()
| en | 0.806165 | #!/usr/bin/env python3 A very simple batch that tests basic functionality. | 1.247593 | 1 |
desafio037.py | mario-nobre/python-guanabara | 0 | 6627539 | <filename>desafio037.py<gh_stars>0
num=int(input('digite um número inteiro: '))
print('''colha uma das bases para conversão:
[1] converter para BINÁRIO
[2] converter para OCTAL
[3] converter para HEXADECIMAL''')
op = int(input('sua opção: '))
if op == 1:
print('{} convertido para BINÁRIO é igual a {}'.format(num, b... | <filename>desafio037.py<gh_stars>0
num=int(input('digite um número inteiro: '))
print('''colha uma das bases para conversão:
[1] converter para BINÁRIO
[2] converter para OCTAL
[3] converter para HEXADECIMAL''')
op = int(input('sua opção: '))
if op == 1:
print('{} convertido para BINÁRIO é igual a {}'.format(num, b... | pt | 0.984661 | colha uma das bases para conversão: [1] converter para BINÁRIO [2] converter para OCTAL [3] converter para HEXADECIMAL | 4.103929 | 4 |
src/morphodict/lexicon/migrations/0004_add_more_defn_types.py | sarahrmoeller/morphodict | 8 | 6627540 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("lexicon", "0003_populate_fst_lemma"),
]
operations = [
migrations.AddField(
model_name="definition",
name="raw_core_definition",
field=models.CharField(
... | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("lexicon", "0003_populate_fst_lemma"),
]
operations = [
migrations.AddField(
model_name="definition",
name="raw_core_definition",
field=models.CharField(
... | none | 1 | 2.122939 | 2 | |
PythonScript/PythonIntermedio/cap_4/decoradorPython.py | FranklinA/CoursesAndSelfStudy | 0 | 6627541 | #
def primerD(funcion):
def funcionDecorada(*args,**kkwars):#para recibir parametros
print("Primer decorador")
return funcionDecorada
@primerD # debde coincidir con una funcion existente en este caso primerD para usarla en la funcion funcion()
def funcion():
print('Mi primer decorador')
funcion()
| #
def primerD(funcion):
def funcionDecorada(*args,**kkwars):#para recibir parametros
print("Primer decorador")
return funcionDecorada
@primerD # debde coincidir con una funcion existente en este caso primerD para usarla en la funcion funcion()
def funcion():
print('Mi primer decorador')
funcion()
| es | 0.876283 | # #para recibir parametros # debde coincidir con una funcion existente en este caso primerD para usarla en la funcion funcion() | 3.046314 | 3 |
app/scrape/scrape.py | luiscape/hdxscraper-opennepal | 0 | 6627542 | <reponame>luiscape/hdxscraper-opennepal
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urlparse
import requests
from bs4 import BeautifulSoup
def ScrapeURLs(page, filters=True, verbose=False):
'''Scrapes the OpenNepal website for dataset URLs.'''
if verbose:
print 'Scraping the OpenNepal page: %s' % page
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urlparse
import requests
from bs4 import BeautifulSoup
def ScrapeURLs(page, filters=True, verbose=False):
'''Scrapes the OpenNepal website for dataset URLs.'''
if verbose:
print 'Scraping the OpenNepal page: %s' % page
#
# Assemble URL.
#
u = 'http://... | en | 0.686056 | #!/usr/bin/python # -*- coding: utf-8 -*- Scrapes the OpenNepal website for dataset URLs. # # Assemble URL. # # # Download data from OpenNepal's website. # # # Find data with BeautifulSoup. # # # Finds href. # Scraping content from each dataset. # # Download data from OpenNepal's website. # # # Title. # # # Tags. # # #... | 3.090371 | 3 |
Frameworks/Examples/SVM_IRIS.py | CrispyKernel/GetTuned | 0 | 6627543 | <reponame>CrispyKernel/GetTuned<filename>Frameworks/Examples/SVM_IRIS.py
"""
@Description: We will evaluate the performance of "Gaussian Process with EI acquisition function" HPO method
implemented in a simple context with a fixed total budget of (100x200x4 = 80000 epochs),
... | """
@Description: We will evaluate the performance of "Gaussian Process with EI acquisition function" HPO method
implemented in a simple context with a fixed total budget of (100x200x4 = 80000 epochs),
a max budget per config of 800 epochs and a number of fou... | en | 0.660361 | @Description: We will evaluate the performance of "Gaussian Process with EI acquisition function" HPO method implemented in a simple context with a fixed total budget of (100x200x4 = 80000 epochs), a max budget per config of 800 epochs and a number of four cross v... | 2.387496 | 2 |
cyder/core/system/forms.py | jwasinger/cyder | 0 | 6627544 | <reponame>jwasinger/cyder<gh_stars>0
from django import forms
from cyder.base.eav.forms import get_eav_form
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.system.models import System, SystemAV
class SystemForm(forms.ModelForm):
class Meta:
model = System
class ExtendedSystemForm(form... | from django import forms
from cyder.base.eav.forms import get_eav_form
from cyder.base.mixins import UsabilityFormMixin
from cyder.core.system.models import System, SystemAV
class SystemForm(forms.ModelForm):
class Meta:
model = System
class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin):
... | none | 1 | 2.042267 | 2 | |
tests/test_process_.py | QSD-Group/QSDsan | 23 | 6627545 | # -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
<NAME> <<EMAIL>>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-Group/QSDsan/blob/main/LICENSE.txt
for lic... | # -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
<NAME> <<EMAIL>>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-Group/QSDsan/blob/main/LICENSE.txt
for lic... | en | 0.883183 | # -*- coding: utf-8 -*- QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems This module is developed by: <NAME> <<EMAIL>> This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-Group/QSDsan/blob/main/LICENSE.txt for license... | 1.886925 | 2 |
src/stat/var.py | easai/stat | 0 | 6627546 | <gh_stars>0
import numpy as np
from statistics import mean, median,variance,stdev
x=[]
x.append([-5,-10])
x.append([0,3])
x.append([2,11])
x.append([3,14])
xrow=[y[0] for y in x]
var = np.var(x, axis=0)
print(f"{var=}")
var = np.var(xrow)
print(f"{var=}")
var=variance(xrow)
print(f"{var=}")
var = np.array(xrow).var()
... | import numpy as np
from statistics import mean, median,variance,stdev
x=[]
x.append([-5,-10])
x.append([0,3])
x.append([2,11])
x.append([3,14])
xrow=[y[0] for y in x]
var = np.var(x, axis=0)
print(f"{var=}")
var = np.var(xrow)
print(f"{var=}")
var=variance(xrow)
print(f"{var=}")
var = np.array(xrow).var()
print(f"{var... | none | 1 | 3.175624 | 3 | |
utils/dirs.py | BeyondCloud/TF_Template | 0 | 6627547 | import os
def create_dirs_if_not_exist(dirs):
"""
dirs - a list of directories to create if these directories are not found
:param dirs:
:return exit_code: 0:success -1:failed
"""
try:
for dir_ in dirs:
if not os.path.exists(dir_):
os.makedirs(dir_)
... | import os
def create_dirs_if_not_exist(dirs):
"""
dirs - a list of directories to create if these directories are not found
:param dirs:
:return exit_code: 0:success -1:failed
"""
try:
for dir_ in dirs:
if not os.path.exists(dir_):
os.makedirs(dir_)
... | en | 0.788793 | dirs - a list of directories to create if these directories are not found :param dirs: :return exit_code: 0:success -1:failed | 4.151218 | 4 |
main.py | kanishka100/library | 0 | 6627548 | <reponame>kanishka100/library<gh_stars>0
from flask import Flask, render_template, request, url_for
from flask_sqlalchemy import SQLAlchemy
from werkzeug.utils import redirect
app = Flask(__name__)
all_books = []
# creating database
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///new-books-collection.db'
app.conf... | from flask import Flask, render_template, request, url_for
from flask_sqlalchemy import SQLAlchemy
from werkzeug.utils import redirect
app = Flask(__name__)
all_books = []
# creating database
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///new-books-collection.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = Fa... | en | 0.713856 | # creating database # creating table model # this is optional,helps in identifing each book object # create table # new_book = Book(id=1, title='<NAME>', author="J.K.Rowlings", rating=9.2) # db.session.add(new_book) # db.session.commit() Home page The data type of the result returned on querying the database is a list.... | 3.110517 | 3 |
backend/surveybackend/surveybackend/core/views.py | huarngpa/huarngpa_norc_challenge | 0 | 6627549 | <reponame>huarngpa/huarngpa_norc_challenge<gh_stars>0
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm
from django.contrib.auth import update_session_auth_hash, login, authenticate
from django.contrib import mes... | from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm
from django.contrib.auth import update_session_auth_hash, login, authenticate
from django.contrib import messages
from django.shortcuts import render, redirect
f... | en | 0.968116 | # Create your views here. | 2.17174 | 2 |
robocrys/tests/adapter.py | kgmat/robocrystallographer | 0 | 6627550 | <filename>robocrys/tests/adapter.py
from robocrys.adapter import BaseAdapter
from robocrys.tests import RobocrysTest
class TestDescriptionAdapter(RobocrysTest):
"""Class to test the base adapter functionality."""
def setUp(self):
tin_dioxide = self.get_condensed_structure("SnO2")
self.tin_dio... | <filename>robocrys/tests/adapter.py
from robocrys.adapter import BaseAdapter
from robocrys.tests import RobocrysTest
class TestDescriptionAdapter(RobocrysTest):
"""Class to test the base adapter functionality."""
def setUp(self):
tin_dioxide = self.get_condensed_structure("SnO2")
self.tin_dio... | en | 0.711557 | Class to test the base adapter functionality. # test get distance using int works # test get distance using list works # test getting multiple distances # test get angles using int works # test get angles using list works | 2.838845 | 3 |