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 |
|---|---|---|---|---|---|---|---|---|---|---|
results/nim_1b_table_of_bad_lm.py | SourCherries/auto-face-align | 13 | 6628851 | <reponame>SourCherries/auto-face-align
import os
import csv
expression = ["an", "ca", "di", "fe", "ha", "ne", "sa", "sp"]
mouth = ["o", "c"]
databases = []
my_project_path = os.path.dirname(os.path.abspath(__file__))
# Output to long format CSV with everything broken down.
# MOUTH [o c]
# EXPRESSION [an .... | import os
import csv
expression = ["an", "ca", "di", "fe", "ha", "ne", "sa", "sp"]
mouth = ["o", "c"]
databases = []
my_project_path = os.path.dirname(os.path.abspath(__file__))
# Output to long format CSV with everything broken down.
# MOUTH [o c]
# EXPRESSION [an ... sp]
# STRICT [YES, NO]
# NU... | en | 0.51467 | # Output to long format CSV with everything broken down. # MOUTH [o c] # EXPRESSION [an ... sp] # STRICT [YES, NO] # NUMBER The number of excluded # writer.write("Mouth,Expression,Strict,Number\n") # END ------------------------------------------------------------------------- # ---------------... | 3.152941 | 3 |
src/controles.py | neviim/ytbviews | 0 | 6628852 | """
Modulo com a classe Canais
Esta classe é para instanciar e ler cada canal no youtube
o qual sera especificado em um arquivo json de reverencia
de leitura, para o processamento
Os dados desta instancia sera usado para gerar e gravar um
arquivo de saida com as novas referncias capturadas no youtube.
"""
import dat... | """
Modulo com a classe Canais
Esta classe é para instanciar e ler cada canal no youtube
o qual sera especificado em um arquivo json de reverencia
de leitura, para o processamento
Os dados desta instancia sera usado para gerar e gravar um
arquivo de saida com as novas referncias capturadas no youtube.
"""
import dat... | pt | 0.942461 | Modulo com a classe Canais Esta classe é para instanciar e ler cada canal no youtube o qual sera especificado em um arquivo json de reverencia de leitura, para o processamento Os dados desta instancia sera usado para gerar e gravar um arquivo de saida com as novas referncias capturadas no youtube. Classe Canais Entra... | 4.07272 | 4 |
class2/exercises/exercise1.py | twin-bridges/netmiko_course | 11 | 6628853 | import os
from getpass import getpass
from netmiko import ConnectHandler
import logging
logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")
# Code so automated tests will run properly
password = os.getenv("NETMIKO_PASSWORD") if os.getenv("NETMIKO_PASSWORD") else getpas... | import os
from getpass import getpass
from netmiko import ConnectHandler
import logging
logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")
# Code so automated tests will run properly
password = os.getenv("NETMIKO_PASSWORD") if os.getenv("NETMIKO_PASSWORD") else getpas... | en | 0.656469 | # Code so automated tests will run properly | 2.319171 | 2 |
time_tree.py | pyensemble/wildwood | 22 | 6628854 |
import logging
import numpy as np
import pandas as pd
from sklearn.datasets import make_circles, make_moons
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier as SkDecisionTreeClassifier
from sklearn.tree import ExtraTreeClassifier as SkExtraTreeClassifier
from wildwo... |
import logging
import numpy as np
import pandas as pd
from sklearn.datasets import make_circles, make_moons
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier as SkDecisionTreeClassifier
from sklearn.tree import ExtraTreeClassifier as SkExtraTreeClassifier
from wildwo... | en | 0.318606 | # n_samples = 100_000 # classifiers = [ # ("tree", DecisionTreeClassifier(**clf_kwargs)), # ("sk_tree", SkDecisionTreeClassifier(**clf_kwargs)), # ("sk_extra", SkExtraTreeClassifier(**clf_kwargs)) # ] # cprofile # n_samples = 1_000_000 # X, y = make_circles(n_samples=n_samples, noise=0.2, factor=0.5, random... | 2.473091 | 2 |
lambda/run-step-functions-lambda.py | sg09/aws | 0 | 6628855 | <reponame>sg09/aws
import json
import boto3
import json
import os
stepfunctions_client = boto3.client('stepfunctions')
def lambda_handler(event, context):
s3event = event['Records'][0]['s3']
s3bucket = s3event['bucket']['name']
s3key = s3event['object']['key']
step_state = {
"s3_bucket": s3buc... | import json
import boto3
import json
import os
stepfunctions_client = boto3.client('stepfunctions')
def lambda_handler(event, context):
s3event = event['Records'][0]['s3']
s3bucket = s3event['bucket']['name']
s3key = s3event['object']['key']
step_state = {
"s3_bucket": s3bucket,
"s3_vi... | none | 1 | 1.937354 | 2 | |
paddlex/cv/transforms/seg_transforms.py | SunAhong1993/PaddleX | 1 | 6628856 | # coding: utf8
# copyright (c) 2020 PaddlePaddle 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 req... | # coding: utf8
# copyright (c) 2020 PaddlePaddle 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 req... | zh | 0.789983 | # coding: utf8 # copyright (c) 2020 PaddlePaddle 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 req... | 2.107641 | 2 |
iseq_prof/__init__.py | EBI-Metagenomics/iseq-prof | 0 | 6628857 | <filename>iseq_prof/__init__.py
from importlib import import_module as _import_module
from . import fasta, filedb, pfam, plot, sam, solut_space
from ._accession import Accession
from ._cache import turn_cache_on
from ._cli import cli
from ._confusion import ConfusionMatrix
from ._genbank import GenBank, genbank_catalo... | <filename>iseq_prof/__init__.py
from importlib import import_module as _import_module
from . import fasta, filedb, pfam, plot, sam, solut_space
from ._accession import Accession
from ._cache import turn_cache_on
from ._cli import cli
from ._confusion import ConfusionMatrix
from ._genbank import GenBank, genbank_catalo... | none | 1 | 1.579161 | 2 | |
snowfakery/template_funcs.py | adamlincoln/Snowfakery | 0 | 6628858 | import random
from datetime import date, datetime
import dateutil.parser
from ast import literal_eval
from typing import Callable, Any, Optional, Union, List, Tuple
from faker import Faker
from .data_gen_exceptions import DataGenError
import snowfakery.data_generator_runtime # noqa
RuntimeContext = "snowfakery.da... | import random
from datetime import date, datetime
import dateutil.parser
from ast import literal_eval
from typing import Callable, Any, Optional, Union, List, Tuple
from faker import Faker
from .data_gen_exceptions import DataGenError
import snowfakery.data_generator_runtime # noqa
RuntimeContext = "snowfakery.da... | en | 0.835846 | # noqa # It might make more sense to use context vars for context handling when # Python 3.6 is out of the support matrix. A lazy function is one that expects its arguments to be unparsed Pick a random number between min and max like Python's randint. For constructs like: - choice: probability: 60% ... | 2.707762 | 3 |
astropy/coordinates/earth.py | Apoorve73/astropy | 0 | 6628859 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from warnings import warn
import collections
import socket
import json
import urllib.request
import urllib.error
import urllib.parse
import numpy as np
import erfa
from astropy import units as u
from astropy import constants as consts
from astropy.units... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from warnings import warn
import collections
import socket
import json
import urllib.request
import urllib.error
import urllib.parse
import numpy as np
import erfa
from astropy import units as u
from astropy import constants as consts
from astropy.units... | en | 0.726322 | # Licensed under a 3-clause BSD style license - see LICENSE.rst # Available ellipsoids (defined in erfam.h, with numbers exposed in erfa). Rotational velocity of Earth. In UT1 seconds, this would be 2 pi / (24 * 3600), but we need the value in SI seconds. See Explanatory Supplement to the Astronomical Almanac, ed. P. <... | 2.631964 | 3 |
python/setup.py | OpenNMT/CTranslate2 | 259 | 6628860 | import os
import sys
import pybind11
from setuptools import setup, find_packages, Extension
base_dir = os.path.dirname(os.path.abspath(__file__))
include_dirs = [pybind11.get_include()]
library_dirs = []
def _get_long_description():
readme_path = os.path.join(base_dir, "README.md")
if not os.path.exists(re... | import os
import sys
import pybind11
from setuptools import setup, find_packages, Extension
base_dir = os.path.dirname(os.path.abspath(__file__))
include_dirs = [pybind11.get_include()]
library_dirs = []
def _get_long_description():
readme_path = os.path.join(base_dir, "README.md")
if not os.path.exists(re... | en | 0.228905 | # std::visit requires macOS 10.14 | 1.986231 | 2 |
tests/fixes/test_base_class.py | dmendelsohn/pytestify | 12 | 6628861 | import pytest
from pytestify.fixes.base_class import remove_base_class
@pytest.mark.parametrize(
'before, after', [
('class Cls(unittest.TestCase): pass', 'class TestCls: pass'),
('class Cls(TestCase): pass', 'class TestCls: pass'),
('class TestCls(unittest.TestCase): pass', 'class TestCl... | import pytest
from pytestify.fixes.base_class import remove_base_class
@pytest.mark.parametrize(
'before, after', [
('class Cls(unittest.TestCase): pass', 'class TestCls: pass'),
('class Cls(TestCase): pass', 'class TestCls: pass'),
('class TestCls(unittest.TestCase): pass', 'class TestCl... | none | 1 | 2.619202 | 3 | |
4.select/5.Mm.get_hits_dynamic_e.py | oaxiom/episcan | 0 | 6628862 | #!/usr/bin/env python3
import numpy, pickle
from glbase3 import *
import matplotlib.pyplot as plot
'''
Round 1, For each domain, work out a dynamic threshold for each motif, and discard motifs that are useless
'''
final_results = {}
model_matrix = glload('../3.model/AUCtable.glb')
dynamicE = {d['domain']: float(d['... | #!/usr/bin/env python3
import numpy, pickle
from glbase3 import *
import matplotlib.pyplot as plot
'''
Round 1, For each domain, work out a dynamic threshold for each motif, and discard motifs that are useless
'''
final_results = {}
model_matrix = glload('../3.model/AUCtable.glb')
dynamicE = {d['domain']: float(d['... | en | 0.659064 | #!/usr/bin/env python3 Round 1, For each domain, work out a dynamic threshold for each motif, and discard motifs that are useless ######### # add wether it is in Epifactors DB, or not; # Filtered result | 2.307957 | 2 |
enhanced_rds/metric_maps.py | theletterf/enhanced-rds-monitoring | 5 | 6628863 | """
The default structure(s) of the metric payloads delivered to the Lambda.
Note that the Aurora section only contains the structures in which there is
meaningful difference from the standard version.
"""
# Standard set of metric info
METRICS = [
'cpuUtilization',
'diskIO',
'fileSys',
'loa... | """
The default structure(s) of the metric payloads delivered to the Lambda.
Note that the Aurora section only contains the structures in which there is
meaningful difference from the standard version.
"""
# Standard set of metric info
METRICS = [
'cpuUtilization',
'diskIO',
'fileSys',
'loa... | en | 0.823701 | The default structure(s) of the metric payloads delivered to the Lambda. Note that the Aurora section only contains the structures in which there is meaningful difference from the standard version. # Standard set of metric info # Metric info for Aurora instances. # Workaround to account for Aurora diskIO metric... | 1.598426 | 2 |
garage/tf/core/mlp.py | XavierJingfeng/starter | 0 | 6628864 | """MLP model in TensorFlow."""
import tensorflow as tf
def mlp(input_var,
output_dim,
hidden_sizes,
name,
hidden_nonlinearity=tf.nn.relu,
hidden_w_init=tf.glorot_uniform_initializer,
hidden_b_init=tf.zeros_initializer,
output_nonlinearity=None,
output_w... | """MLP model in TensorFlow."""
import tensorflow as tf
def mlp(input_var,
output_dim,
hidden_sizes,
name,
hidden_nonlinearity=tf.nn.relu,
hidden_w_init=tf.glorot_uniform_initializer,
hidden_b_init=tf.zeros_initializer,
output_nonlinearity=None,
output_w... | en | 0.541819 | MLP model in TensorFlow. MLP model. Args: input_var: Input tf.Tensor to the MLP. output_dim: Dimension of the network output. hidden_sizes: Output dimension of dense layer(s). name: variable scope of the mlp. hidden_nonlinearity: Activation function for i... | 3.297006 | 3 |
data/external/repositories_2to3/113677/KaggleBillionWordImputation-master/scripts/compare_pos.py | Keesiu/meta-kaggle | 0 | 6628865 | #!/usr/bin/env python
'''
Compare POS tags to a gold standard.
'''
import sys, argparse, pickle
from collections import defaultdict
from util import tokenize_words, pos_tag
def opts():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('sample', type=argparse.FileType('r'... | #!/usr/bin/env python
'''
Compare POS tags to a gold standard.
'''
import sys, argparse, pickle
from collections import defaultdict
from util import tokenize_words, pos_tag
def opts():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('sample', type=argparse.FileType('r'... | en | 0.263353 | #!/usr/bin/env python Compare POS tags to a gold standard. | 3.045237 | 3 |
backend/utils/middlewares.py | matrixhawk/eastmoney | 31 | 6628866 | import json
import math
import time
import functools
from json import JSONDecodeError
from django.urls import resolve
from apps.log.models import Log
def SaveLogMiddleware(func):
@functools.wraps(func)
def _inner(request, *args, **kwargs):
start = time.time()
bdata = request.body
if ... | import json
import math
import time
import functools
from json import JSONDecodeError
from django.urls import resolve
from apps.log.models import Log
def SaveLogMiddleware(func):
@functools.wraps(func)
def _inner(request, *args, **kwargs):
start = time.time()
bdata = request.body
if ... | zh | 0.976061 | # 这里是真实的ip # 这里是代理ip | 2.146899 | 2 |
mundo2/parte3/parteb/ex068.py | fcdennis/CursoPython | 0 | 6628867 | from random import randint
print('=-' * 13)
print('VAMOS JOGAR PAR OU ÍMPAR')
print('=-' * 13)
placar = 0
while True:
computador = randint(0, 9)
jogador = int(input('Diga um valor? '))
total = computador + jogador
pergunta = input('Par ou Ímpar? [P / I] ')
while pergunta not in 'PpIi':
pergu... | from random import randint
print('=-' * 13)
print('VAMOS JOGAR PAR OU ÍMPAR')
print('=-' * 13)
placar = 0
while True:
computador = randint(0, 9)
jogador = int(input('Diga um valor? '))
total = computador + jogador
pergunta = input('Par ou Ímpar? [P / I] ')
while pergunta not in 'PpIi':
pergu... | none | 1 | 3.821515 | 4 | |
work/wamplet1/wamplet1/component1.py | haizaar/crossbar-examples | 97 | 6628868 | <reponame>haizaar/crossbar-examples
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | en | 0.731007 | ############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with... | 1.749801 | 2 |
fairseq/models/pronouns.py | liufly/refreader | 19 | 6628869 | from collections import defaultdict
# name list obtained from: https://www.ssa.gov/oact/babynames/decades/century.html
# accessed on Nov 6th, 2018
class PronounLexicon():
def __init__(self, lexfile='pronouns.tsv'):
self.lexicon = defaultdict(lambda : [])
with open(lexfile) as fin:
for ... | from collections import defaultdict
# name list obtained from: https://www.ssa.gov/oact/babynames/decades/century.html
# accessed on Nov 6th, 2018
class PronounLexicon():
def __init__(self, lexfile='pronouns.tsv'):
self.lexicon = defaultdict(lambda : [])
with open(lexfile) as fin:
for ... | en | 0.898597 | # name list obtained from: https://www.ssa.gov/oact/babynames/decades/century.html # accessed on Nov 6th, 2018 given a fairseq dictionary, export a list of word idxs that match a desired feature # print(marked_sentence) # print(gaps) # l = 32 covers 81.5% of the sentences # l = 64 covers 98.4% of the sentences # l = 10... | 3.227297 | 3 |
bot/exts/evergreen/battleship.py | AbooMinister25/sir-lancebot | 0 | 6628870 | <gh_stars>0
import asyncio
import logging
import random
import re
import typing
from dataclasses import dataclass
from functools import partial
import discord
from discord.ext import commands
from bot.constants import Colours
log = logging.getLogger(__name__)
@dataclass
class Square:
"""Each square on the batt... | import asyncio
import logging
import random
import re
import typing
from dataclasses import dataclass
from functools import partial
import discord
from discord.ext import commands
from bot.constants import Colours
log = logging.getLogger(__name__)
@dataclass
class Square:
"""Each square on the battleship grid ... | en | 0.93882 | Each square on the battleship grid - if they contain a boat and if they've been aimed at. Each player in the game - their messages for the boards and their current grid. # The name of the ship and its size # For these two variables, the first boolean is whether the square is a ship (True) or not (False). # The second b... | 3.239107 | 3 |
tests/datasets/svmrank/test_mslr10k.py | rjagerman/pytorchltr | 37 | 6628871 | <filename>tests/datasets/svmrank/test_mslr10k.py
import os
import pytest
from pytorchltr.datasets.svmrank.mslr10k import MSLR10K
from tests.datasets.svmrank.test_svmrank import mock_svmrank_dataset
pkg = "pytorchltr.datasets.svmrank.mslr10k"
def test_wrong_split_raises_error():
with mock_svmrank_dataset(pkg) a... | <filename>tests/datasets/svmrank/test_mslr10k.py
import os
import pytest
from pytorchltr.datasets.svmrank.mslr10k import MSLR10K
from tests.datasets.svmrank.test_svmrank import mock_svmrank_dataset
pkg = "pytorchltr.datasets.svmrank.mslr10k"
def test_wrong_split_raises_error():
with mock_svmrank_dataset(pkg) a... | none | 1 | 2.318128 | 2 | |
run.py | Edudeiko/dj_helper_search_api | 1 | 6628872 | <gh_stars>1-10
from support import *
from dotenv import load_dotenv
import os
import requests
from flask import Flask, request, jsonify, Response
import pandas as pd
import json
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestNeighbors
load_dotenv() # load environment variabl... | from support import *
from dotenv import load_dotenv
import os
import requests
from flask import Flask, request, jsonify, Response
import pandas as pd
import json
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestNeighbors
load_dotenv() # load environment variables
app = Flask... | en | 0.732099 | # load environment variables check if app is live search for songs search for songs in desired format # orient='values', 'records', 'index', 'columns' get songs with audio features start index count from 1 instead of 0 apply the function creat columns names for the dataframe get similar songs depending on the audio fea... | 2.781782 | 3 |
nova/virt/xenapi/pool.py | bopopescu/zknova | 0 | 6628873 | <filename>nova/virt/xenapi/pool.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Citrix Systems, Inc.
# Copyright 2010 OpenStack LLC.
#
# 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 cop... | <filename>nova/virt/xenapi/pool.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Citrix Systems, Inc.
# Copyright 2010 OpenStack LLC.
#
# 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 cop... | en | 0.895238 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Citrix Systems, Inc. # Copyright 2010 OpenStack LLC. # # 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... | 1.948844 | 2 |
Code/DAY 2/GitHub_API_Java_REST.py | Viswalahiri/Internship_Agilitix | 0 | 6628874 | <filename>Code/DAY 2/GitHub_API_Java_REST.py
import requests
import json
from pprint import pprint
for i in range(10):
url = f"https://api.github.com/search/repositories?q=language:Java&topic=REST"
data = requests.get(url).json()
f = open("Java_Rest.json", "w")
with open("Java_Rest.json", "a") as outfile:
json.d... | <filename>Code/DAY 2/GitHub_API_Java_REST.py
import requests
import json
from pprint import pprint
for i in range(10):
url = f"https://api.github.com/search/repositories?q=language:Java&topic=REST"
data = requests.get(url).json()
f = open("Java_Rest.json", "w")
with open("Java_Rest.json", "a") as outfile:
json.d... | none | 1 | 3.175736 | 3 | |
bip_utils/substrate/conf/__init__.py | MIPPLTeam/bip_utils | 149 | 6628875 | from bip_utils.substrate.conf.substrate_coins import SubstrateCoins
from bip_utils.substrate.conf.substrate_coin_conf import SubstrateCoinConf
from bip_utils.substrate.conf.substrate_conf import SubstrateConf
from bip_utils.substrate.conf.substrate_conf_getter import SubstrateConfGetter
| from bip_utils.substrate.conf.substrate_coins import SubstrateCoins
from bip_utils.substrate.conf.substrate_coin_conf import SubstrateCoinConf
from bip_utils.substrate.conf.substrate_conf import SubstrateConf
from bip_utils.substrate.conf.substrate_conf_getter import SubstrateConfGetter
| none | 1 | 1.051392 | 1 | |
test/model/test_boats.py | vishalbelsare/sparsereg | 49 | 6628876 | <reponame>vishalbelsare/sparsereg
import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.exceptions import FitFailedWarning
from sparsereg.model import BoATS, STRidge, fit_with_noise
np.random.seed(42)
@pytest.mark.parametrize("lmc", [LinearRegression, Ridge, STRidge]... | import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.exceptions import FitFailedWarning
from sparsereg.model import BoATS, STRidge, fit_with_noise
np.random.seed(42)
@pytest.mark.parametrize("lmc", [LinearRegression, Ridge, STRidge])
@pytest.mark.parametrize("sigma"... | none | 1 | 2.264782 | 2 | |
whereamigeo/whereamigeo/helper.py | MLH-Fellowship/hackathon-geography | 0 | 6628877 | from functools import reduce
from whereamigeo.mappings import map, word_to_plus_code_mapping
sep = '.'
def get_word(code: str):
return map[code]
def get_code(word: str):
return word_to_plus_code_mapping[word]
def get_olc_array(olc: str, inc: int):
code = olc.replace('+', '')
return [code[i: i +... | from functools import reduce
from whereamigeo.mappings import map, word_to_plus_code_mapping
sep = '.'
def get_word(code: str):
return map[code]
def get_code(word: str):
return word_to_plus_code_mapping[word]
def get_olc_array(olc: str, inc: int):
code = olc.replace('+', '')
return [code[i: i +... | en | 0.605455 | # Split string into array of 2 char elements. # Convert coded array to word phrase. | 3.504435 | 4 |
pyxnvme/examples/device_info.py | karlowich/xNVMe | 83 | 6628878 | <gh_stars>10-100
#!/usr/bin/env python3
from xnvme import CAPI as capi
def main():
"""Example entry point"""
dev = capi.xnvme_dev_open(b"/dev/nvme0n1")
capi.xnvme_dev_pr(dev, 0x0)
geo = capi.xnvme_dev_get_geo(dev)
if not geo:
return
capi.xnvme_geo_pr(geo, 0x0)
if __name__ == "__main... | #!/usr/bin/env python3
from xnvme import CAPI as capi
def main():
"""Example entry point"""
dev = capi.xnvme_dev_open(b"/dev/nvme0n1")
capi.xnvme_dev_pr(dev, 0x0)
geo = capi.xnvme_dev_get_geo(dev)
if not geo:
return
capi.xnvme_geo_pr(geo, 0x0)
if __name__ == "__main__":
main() | en | 0.194516 | #!/usr/bin/env python3 Example entry point | 2.361639 | 2 |
utils.py | ikuroNoriiwa/shellcode_transform | 2 | 6628879 | <reponame>ikuroNoriiwa/shellcode_transform<filename>utils.py
#!/usr/bin/python3
from sys import exit
def error(msg):
print("\033[31mError: {}\033[0m".format(msg))
exit(1) | #!/usr/bin/python3
from sys import exit
def error(msg):
print("\033[31mError: {}\033[0m".format(msg))
exit(1) | fr | 0.386793 | #!/usr/bin/python3 | 2.418152 | 2 |
src/tests/fft/fft-conv-poc.py | ppwwyyxx/haDNN | 23 | 6628880 | <reponame>ppwwyyxx/haDNN
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: fft-conv-poc.py
# Author: <NAME> <<EMAIL>>
import numpy as np
import scipy.signal
import numpy.fft
import cv2
image2d = np.random.rand(200, 200)
image2dp = np.pad(image2d, ((1,1),(1,1)), mode='constant') # pad then fft
kernel = np.random.... | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: fft-conv-poc.py
# Author: <NAME> <<EMAIL>>
import numpy as np
import scipy.signal
import numpy.fft
import cv2
image2d = np.random.rand(200, 200)
image2dp = np.pad(image2d, ((1,1),(1,1)), mode='constant') # pad then fft
kernel = np.random.rand(3,3)
img_f = np.fft... | en | 0.318492 | #!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: fft-conv-poc.py # Author: <NAME> <<EMAIL>> # pad then fft # 2 == pad*2 = 3//2 * 2 #from IPython import embed; embed() | 2.628398 | 3 |
tests/models/test_sensorinstance.py | shashijangra/airflow-1 | 2 | 6628881 | <filename>tests/models/test_sensorinstance.py
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | <filename>tests/models/test_sensorinstance.py
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | en | 0.857657 | # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not... | 1.949998 | 2 |
angr/angr/engines/vex/statements/base.py | Ruide/angr-dev | 0 | 6628882 | import logging
l = logging.getLogger("angr.engines.vex.statements.base")
class SimIRStmt(object):
"""A class for symbolically translating VEX IRStmts."""
def __init__(self, stmt, state):
self.stmt = stmt
self.state = state
# references by the statement
self.actions = []
... | import logging
l = logging.getLogger("angr.engines.vex.statements.base")
class SimIRStmt(object):
"""A class for symbolically translating VEX IRStmts."""
def __init__(self, stmt, state):
self.stmt = stmt
self.state = state
# references by the statement
self.actions = []
... | en | 0.873851 | A class for symbolically translating VEX IRStmts. # references by the statement Process the statement, applying its effects on the state. # this is where we would choose between different analysis modes Translates an IRExpr into a SimIRExpr. Translates a sequence of IRExprs into SimIRExprs. Records the references of an... | 2.721287 | 3 |
tests/testCallbacksRegex.py | while-loop/Twitch-IRC | 0 | 6628883 | <gh_stars>0
import inspect
import time
import unittest
from types import FunctionType
from twitchirc.irc import IRC
class TestCallbacks(unittest.TestCase):
CHANNEL = "testchannel"
VIEWER = "testviewer"
USER = "testuser"
tests = None
def setUp(self):
if not TestCallbacks.tests:
... | import inspect
import time
import unittest
from types import FunctionType
from twitchirc.irc import IRC
class TestCallbacks(unittest.TestCase):
CHANNEL = "testchannel"
VIEWER = "testviewer"
USER = "testuser"
tests = None
def setUp(self):
if not TestCallbacks.tests:
TestCallba... | en | 0.289586 | # allow the callbacks to be executed #{channel} :{message}".format( #{channel} :{shebang}{command} {value}".format( #{channel} :{shebang}{command} {value}".format( #{channel}".format( #{channel}".format( #{channel} {op}o {viewer}".format( #{channel} {op}o {viewer}".format( #{channel} :{message}".format( #{channel} :{me... | 2.512167 | 3 |
topConfigs/crabConfigPPSample.py | mverwe/UserCode | 0 | 6628884 | <filename>topConfigs/crabConfigPPSample.py
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.section_('General')
config.General.requestName = 'HighPtJet80_v1'
config.General.workArea = 'crab_projects'
config.General.transferOutputs = True
config.General.transferLogs = False
... | <filename>topConfigs/crabConfigPPSample.py
from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.section_('General')
config.General.requestName = 'HighPtJet80_v1'
config.General.workArea = 'crab_projects'
config.General.transferOutputs = True
config.General.transferLogs = False
... | en | 0.289717 | #config.Data.inputDBS = 'phys03' #True #config.Site.whitelist = ['T2_US_MIT'] #config.Site.blacklist = ['T2_US_Nebraska','T2_US_Florida','T2_US_Wisconsin','T2_US_Caltech'] | 1.568125 | 2 |
services/traction/api/core/config.py | ianco/traction | 0 | 6628885 | import logging
import os
from enum import Enum
from functools import lru_cache
from typing import Optional
from pydantic import BaseSettings, PostgresDsn
logger = logging.getLogger(__name__)
class EnvironmentEnum(str, Enum):
PRODUCTION = "production"
LOCAL = "local"
class GlobalConfig(BaseSettings):
T... | import logging
import os
from enum import Enum
from functools import lru_cache
from typing import Optional
from pydantic import BaseSettings, PostgresDsn
logger = logging.getLogger(__name__)
class EnvironmentEnum(str, Enum):
PRODUCTION = "production"
LOCAL = "local"
class GlobalConfig(BaseSettings):
T... | en | 0.766426 | # the following defaults match up with default values in scripts/.env.example # these MUST be all set in non-local environments. # application connection is async # fmt: off # noqa: E501 # migrations connection uses owner role and is synchronous # noqa: E501 # fmt: on # Api V1 prefix # openssl rand -hex 32 Local config... | 2.367408 | 2 |
syft/codes.py | shaunak-gupta/PySyft | 1 | 6628886 | <gh_stars>1-10
class MSGTYPE(object):
CMD = 1
OBJ = 2
OBJ_REQ = 3
OBJ_DEL = 4
EXCEPTION = 5
IS_NONE = 6
code2MSGTYPE = {}
code2MSGTYPE[1] = "CMD"
code2MSGTYPE[2] = "OBJ"
code2MSGTYPE[3] = "OBJ_REQ"
code2MSGTYPE[4] = "OBJ_DEL"
code2MSGTYPE[5] = "EXCEPTION"
code2MSGTYPE[6] = "IS_NONE"
| class MSGTYPE(object):
CMD = 1
OBJ = 2
OBJ_REQ = 3
OBJ_DEL = 4
EXCEPTION = 5
IS_NONE = 6
code2MSGTYPE = {}
code2MSGTYPE[1] = "CMD"
code2MSGTYPE[2] = "OBJ"
code2MSGTYPE[3] = "OBJ_REQ"
code2MSGTYPE[4] = "OBJ_DEL"
code2MSGTYPE[5] = "EXCEPTION"
code2MSGTYPE[6] = "IS_NONE" | none | 1 | 2.289822 | 2 | |
frappe-bench/apps/erpnext/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py | Semicheche/foa_frappe_docker | 0 | 6628887 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import flt
def execute():
from erpnext.stock.stock_balance import repost
repost(allow_zero_rate=True,... | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import flt
def execute():
from erpnext.stock.stock_balance import repost
repost(allow_zero_rate=True,... | en | 0.494912 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt select name, master_name from tabAccount where ifnull(account_type, '') = 'Warehouse' select distinct sle.voucher_type, sle.voucher_no from `tabStock Ledger Entry` sle where sle.warehou... | 1.960664 | 2 |
test_service.py | GovWizely/lambda-endpoint-freshen | 0 | 6628888 | import pytest
import vcr
from service import handler
@vcr.use_cassette()
def test_handler(monkeypatch):
"""Reads from the `test_handler` cassette and processes the request
"""
monkeypatch.setenv("API_KEY", "mykey")
event = dict(freshen_url="https://api.trade.gov/v1/some_endpoint/freshen.json?api_key=... | import pytest
import vcr
from service import handler
@vcr.use_cassette()
def test_handler(monkeypatch):
"""Reads from the `test_handler` cassette and processes the request
"""
monkeypatch.setenv("API_KEY", "mykey")
event = dict(freshen_url="https://api.trade.gov/v1/some_endpoint/freshen.json?api_key=... | en | 0.772495 | Reads from the `test_handler` cassette and processes the request Reads from the `test_handler_fails` cassette and processes the invalid request Reads from the `test_handler_raises` cassette and processes the request that raises Ensures exception raised if api key is not set | 2.425919 | 2 |
quantum/plugins/nec/drivers/pfc.py | hyunsun/quantum | 1 | 6628889 | <gh_stars>1-10
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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:... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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.or... | en | 0.774938 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 NEC Corporation. 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.or... | 2.009288 | 2 |
gui/v1.1/track_gui2.py | vt-gs/tracking | 0 | 6628890 | <reponame>vt-gs/tracking
#!/usr/bin/env python
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4 import Qt
import PyQt4.Qwt5 as Qwt
import numpy as np
from datetime import datetime as date
import sys
from az_QwtDial import *
from el_QwtDial import *
import time
from gpredict import *
class main_widget(QtGu... | #!/usr/bin/env python
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4 import Qt
import PyQt4.Qwt5 as Qwt
import numpy as np
from datetime import datetime as date
import sys
from az_QwtDial import *
from el_QwtDial import *
import time
from gpredict import *
class main_widget(QtGui.QWidget):
def __ini... | en | 0.390684 | #!/usr/bin/env python #QtGui.QMainWindow.__init__(self) #self.setMaximumWidth(900) #self.setMaximumHeight(700) #Callback accessor for tracking control #Feedback Query Auto Update Interval in milliseconds #Callback accessor for gpredict thread control #Gpredict Connection Status, 0=Disconnected, 1=Listening, 2=Connected... | 2.131649 | 2 |
sigal/gallery.py | riton/sigal | 0 | 6628891 | <filename>sigal/gallery.py
# Copyright (c) 2009-2018 - <NAME>
# Copyright (c) 2013 - <NAME>
# Copyright (c) 2014 - <NAME>
# Copyright (c) 2015 - <NAME>.
# Copyright (c) 2017 - <NAME>
# Copyright (c) 2018 - <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | <filename>sigal/gallery.py
# Copyright (c) 2009-2018 - <NAME>
# Copyright (c) 2013 - <NAME>
# Copyright (c) 2014 - <NAME>
# Copyright (c) 2015 - <NAME>.
# Copyright (c) 2017 - <NAME>
# Copyright (c) 2018 - <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | en | 0.762411 | # Copyright (c) 2009-2018 - <NAME> # Copyright (c) 2013 - <NAME> # Copyright (c) 2014 - <NAME> # Copyright (c) 2015 - <NAME>. # Copyright (c) 2017 - <NAME> # Copyright (c) 2018 - <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associa... | 1.534525 | 2 |
definitions.py | sandroboehme/cryptotrader | 2 | 6628892 | <filename>definitions.py
import os
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
CONFIG_PATH = os.path.join(ROOT_PATH, 'config.json')
| <filename>definitions.py
import os
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
CONFIG_PATH = os.path.join(ROOT_PATH, 'config.json')
| none | 1 | 1.822795 | 2 | |
rxsci/math/formal/stddev.py | maki-nage/rxsci | 3 | 6628893 | import math
import rx.operators as ops
import rxsci as rs
def stddev(key_mapper=lambda i: i, reduce=False):
'''Computes standard deviation
The implementation is based on the formal definition of the standard
deviation. This implies that all items are cached in memory to do the
computation. Use the rx... | import math
import rx.operators as ops
import rxsci as rs
def stddev(key_mapper=lambda i: i, reduce=False):
'''Computes standard deviation
The implementation is based on the formal definition of the standard
deviation. This implies that all items are cached in memory to do the
computation. Use the rx... | en | 0.76935 | Computes standard deviation The implementation is based on the formal definition of the standard deviation. This implies that all items are cached in memory to do the computation. Use the rxsci.math.stddev operator to compute standard deviation on a large observable. The source can be an Observabl... | 3.413259 | 3 |
pylark/api_service_bot_add.py | chyroc/pylark | 7 | 6628894 | # Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class AddBotToChatReq(object):
chat_id: str = attr.ib(
default="", metadata={"req_... | # Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class AddBotToChatReq(object):
chat_id: str = attr.ib(
default="", metadata={"req_... | en | 0.424663 | # Code generated by lark_sdk_gen. DO NOT EDIT. # 群的id | 1.953871 | 2 |
python/xpath_reader.py | jasonjimnz/data-science-master | 0 | 6628895 | <filename>python/xpath_reader.py
# lxml library is needed
from lxml import etree
# Location of XML file
XML_FILE = "YOUR_XML_DIR"
# Load the XML File in read mode
xfile = open(XML_FILE, 'r')
# Create a etree instance with the XML content
xml_tree = etree.XML(xfile.read())
# Find all Name nodes with xpath
name_nodes ... | <filename>python/xpath_reader.py
# lxml library is needed
from lxml import etree
# Location of XML file
XML_FILE = "YOUR_XML_DIR"
# Load the XML File in read mode
xfile = open(XML_FILE, 'r')
# Create a etree instance with the XML content
xml_tree = etree.XML(xfile.read())
# Find all Name nodes with xpath
name_nodes ... | en | 0.897567 | # lxml library is needed # Location of XML file # Load the XML File in read mode # Create a etree instance with the XML content # Find all Name nodes with xpath # Find elements in xml_file based in the xpath query | 4.017463 | 4 |
data/dataset.py | TencentYoutuResearch/ActiveLearning-SDM | 4 | 6628896 | <gh_stars>1-10
from torchvision.datasets import VisionDataset
import torch
from PIL import Image
import os
import sys
import numpy as np
# load different dataset
def get_data(name,path,transform=None,tr_or_te='train',n_views=1):
assert name in ['OfficeHome', 'DomainNet', 'Office31']
if name == 'OfficeHome':
... | from torchvision.datasets import VisionDataset
import torch
from PIL import Image
import os
import sys
import numpy as np
# load different dataset
def get_data(name,path,transform=None,tr_or_te='train',n_views=1):
assert name in ['OfficeHome', 'DomainNet', 'Office31']
if name == 'OfficeHome':
return ... | en | 0.404559 | # load different dataset # PIL loader # active learning should implement add_item function and remove_item function # self.samples = np.loadtxt(root, dtype=np.unicode_, delimiter=' ') # sample = torch.cat(sample, dim=1) # sample = self.transform(sample) | 2.615225 | 3 |
dcgm_pbs.py | fengxizhou/dcgm-pbs | 0 | 6628897 | #!/usr/bin/python2
import sys
import argparse
import subprocess
import glob
import re
import os
gpuDeviceRE = re.compile(r'/dev/nvidia\d+')
whilespaceSepRE = re.compile(r'[,\s+]')
dcgmCreateGroupRE = re.compile(r'Successfully.+\s+(\d+)$')
def get_all_supported_gpus():
devices = {}
nvidia_devices = glob.glob... | #!/usr/bin/python2
import sys
import argparse
import subprocess
import glob
import re
import os
gpuDeviceRE = re.compile(r'/dev/nvidia\d+')
whilespaceSepRE = re.compile(r'[,\s+]')
dcgmCreateGroupRE = re.compile(r'Successfully.+\s+(\d+)$')
def get_all_supported_gpus():
devices = {}
nvidia_devices = glob.glob... | en | 0.23361 | #!/usr/bin/python2 #start_collection(args.jobid, args.user, args.group) | 2.513458 | 3 |
kayla/log_helpers/log_http_handler.py | ducminhgd/kayla-project | 0 | 6628898 | """
HTTP Handlers
"""
from logging.handlers import HTTPHandler
import requests
class LogHttpHandler(HTTPHandler):
"""
Simple HTTP Handler
"""
def __init__(self, logPath, host, url, method, protocol='http'):
"""
Constructor
:param logPath: log path on HTTP server
:param... | """
HTTP Handlers
"""
from logging.handlers import HTTPHandler
import requests
class LogHttpHandler(HTTPHandler):
"""
Simple HTTP Handler
"""
def __init__(self, logPath, host, url, method, protocol='http'):
"""
Constructor
:param logPath: log path on HTTP server
:param... | en | 0.519939 | HTTP Handlers Simple HTTP Handler Constructor :param logPath: log path on HTTP server :param host: Host name or IP :param url: URL of web services :param method: HTTP method :param protocol: HTTP or HTTPS Map log record as required format of HTTP/HTTPS server :param recor... | 3.330537 | 3 |
server/server.py | aless80/Tantrix | 3 | 6628899 | <reponame>aless80/Tantrix
import sys
#sys.path.insert(0, '/home/kinkyboy/tantrix/PodSixNet')
sys.path.append('../PodSixNet')
#sys.path.append('./PodSixNet')
#import PodSixNet.Server and PodSixNet.Channel
from PodSixNet.Channel import Channel
from PodSixNet.Server import Server
from time import time, sleep #Ale 09/2017
... | import sys
#sys.path.insert(0, '/home/kinkyboy/tantrix/PodSixNet')
sys.path.append('../PodSixNet')
#sys.path.append('./PodSixNet')
#import PodSixNet.Server and PodSixNet.Channel
from PodSixNet.Channel import Channel
from PodSixNet.Server import Server
from time import time, sleep #Ale 09/2017
import random
class Clien... | en | 0.810003 | #sys.path.insert(0, '/home/kinkyboy/tantrix/PodSixNet') #sys.path.append('./PodSixNet') #import PodSixNet.Server and PodSixNet.Channel #Ale 09/2017 Receive messages from client. NB: self._server refers to tantrixServer ie the instance of TantrixServer # ALE Print the remaining connections #print("\n" + str(self._se... | 2.364068 | 2 |
funnel/views/section.py | jace/goafunnel | 0 | 6628900 | <reponame>jace/goafunnel<filename>funnel/views/section.py
# -*- coding: utf-8 -*-
from flask import render_template, redirect, request, flash
from coaster.views import load_models, load_model
from baseframe import _
from .. import app, lastuser
from ..models import db, ProposalSpace, ProposalSpaceSection
from ..forms... | # -*- coding: utf-8 -*-
from flask import render_template, redirect, request, flash
from coaster.views import load_models, load_model
from baseframe import _
from .. import app, lastuser
from ..models import db, ProposalSpace, ProposalSpaceSection
from ..forms import SectionForm, ConfirmDeleteForm
def section_data(s... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.088415 | 2 |
gpio_multifunction.py | meigrafd/Sample-Code | 10 | 6628901 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# http://www.forum-raspberrypi.de/Thread-python-taster-mit-mehreren-funktionen?pid=134513#pid134513
#
# v0.1 by meigrafd
#
# https://github.com/SoCo/SoCo
#
import sys
from time import sleep, time
import RPi.GPIO as GPIO
import signal
from soco import SoCo
#-------------------... | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# http://www.forum-raspberrypi.de/Thread-python-taster-mit-mehreren-funktionen?pid=134513#pid134513
#
# v0.1 by meigrafd
#
# https://github.com/SoCo/SoCo
#
import sys
from time import sleep, time
import RPi.GPIO as GPIO
import signal
from soco import SoCo
#-------------------... | en | 0.337975 | #!/usr/bin/python # -*- coding: utf-8 -*- # # http://www.forum-raspberrypi.de/Thread-python-taster-mit-mehreren-funktionen?pid=134513#pid134513 # # v0.1 by meigrafd # # https://github.com/SoCo/SoCo # #------------------------------------------------------------------------ #GPIO pins #special function time (in sec) for... | 2.389145 | 2 |
python/photographic_mc_U_Net_like/photographic_continue_train.py | billy000400/Mu2e_MLTracking | 0 | 6628902 | <reponame>billy000400/Mu2e_MLTracking
import sys
from pathlib import Path
import csv
import random
import pickle
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model, initializers, regularizers
from tensorflow.keras.layers import(
Input,
Dense,
Conv2D,
BatchNormalization,
... | import sys
from pathlib import Path
import csv
import random
import pickle
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model, initializers, regularizers
from tensorflow.keras.layers import(
Input,
Dense,
Conv2D,
BatchNormalization,
MaxPool2D,Dropout,
Flatten,
Ti... | none | 1 | 1.600754 | 2 | |
convert_to_threejs.py | mika-co/convert-to-threejs | 7 | 6628903 | # @author zfedoran / http://github.com/zfedoran
import os
import sys
import math
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_prefix = True
option_geometry = False
option_default_camera... | # @author zfedoran / http://github.com/zfedoran
import os
import sys
import math
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
option_prefix = True
option_geometry = False
option_default_camera... | de | 0.339533 | # @author zfedoran / http://github.com/zfedoran # ##################################################### # Globals # ##################################################### # ##################################################### # Templates # ##################################################### # ########################... | 2.500175 | 3 |
fj_scraper.py | diegulio/FirstJob-Scraper | 0 | 6628904 | <reponame>diegulio/FirstJob-Scraper
# -*- coding: utf-8 -*-
import re
# Selenium desde google colab (Webdriver)
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
# Ignoro Deprecation warnings
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarning... | # -*- coding: utf-8 -*-
import re
# Selenium desde google colab (Webdriver)
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
# Ignoro Deprecation warnings
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore")
wd = webdriver.Chrome(o... | es | 0.927458 | # -*- coding: utf-8 -*- # Selenium desde google colab (Webdriver) # Ignoro Deprecation warnings Función que extrae la compañia del trabajo Parameters ---------- job : Elemento html Trabajo. Returns ------- company : str Compañia a la cual pertenece el trabajo. # Extraigo todo ... | 2.704255 | 3 |
chatify/settings/production.py | prashg008/chatify | 1 | 6628905 | from .base import * # noqa
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = os.gete... | from .base import * # noqa
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = os.gete... | en | 0.49818 | # noqa # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts # DATABASES # ---------------------------------------------------------------------------... | 2.03121 | 2 |
CodeWars/Fundamentals/CompleteThePattern/CompleteThePattern2.py | CajetanP/programming-exercises | 1 | 6628906 | <filename>CodeWars/Fundamentals/CompleteThePattern/CompleteThePattern2.py
def pattern(n):
if n < 1:
return ""
res = ""
for i in range(0, n):
for j in range(n, i, -1):
res += str(j)
res += '\n'
if res.endswith('\n'):
res = res[:-1]
return res
print(patter... | <filename>CodeWars/Fundamentals/CompleteThePattern/CompleteThePattern2.py
def pattern(n):
if n < 1:
return ""
res = ""
for i in range(0, n):
for j in range(n, i, -1):
res += str(j)
res += '\n'
if res.endswith('\n'):
res = res[:-1]
return res
print(patter... | none | 1 | 3.794535 | 4 | |
thumbor/filters/watermark.py | bear8421/thumbor | 1 | 6628907 | <filename>thumbor/filters/watermark.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
# pylint: disable=invalid-name
import math
im... | <filename>thumbor/filters/watermark.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
# pylint: disable=invalid-name
import math
im... | en | 0.677662 | #!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com <EMAIL> # pylint: disable=invalid-name # TODO: refactor this # pylint: disable=too-many-statemen... | 2.245723 | 2 |
tests/unit/test_crawl_frontier.py | peterbencze/silene | 0 | 6628908 | <reponame>peterbencze/silene
# 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, sof... | # 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, software
# distributed under the... | en | 0.84267 | # 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, software # distributed under the... | 1.880234 | 2 |
core/migrations/0008_reserv_updated_at.py | justlikedev/tap | 0 | 6628909 | <filename>core/migrations/0008_reserv_updated_at.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2018-06-09 16:47
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies =... | <filename>core/migrations/0008_reserv_updated_at.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2018-06-09 16:47
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies =... | en | 0.724958 | # -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2018-06-09 16:47 | 1.659539 | 2 |
algorithms/two_sum_ii_input_array_is_sorted_test.py | kainonly/leetcode | 0 | 6628910 | import unittest
from .two_sum_ii_input_array_is_sorted import Solution
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.sol = Solution()
def test_example1(self):
self.assertEqual(self.sol.twoSum([2, 7, 11, 15], 9), [1, 2])
| import unittest
from .two_sum_ii_input_array_is_sorted import Solution
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.sol = Solution()
def test_example1(self):
self.assertEqual(self.sol.twoSum([2, 7, 11, 15], 9), [1, 2])
| none | 1 | 3.303768 | 3 | |
archapp/interactive.py | pcdshub/archapp | 1 | 6628911 | <filename>archapp/interactive.py<gh_stars>1-10
"""
interactive.py defines ipython archive interface
"""
import datetime as dt
from datetime import datetime
from typing import Any, Dict
import numpy as np
from . import config, data, mgmt
from .dates import days_map, units_rule
from .doc_sub import doc_sub, doc_sub_tx... | <filename>archapp/interactive.py<gh_stars>1-10
"""
interactive.py defines ipython archive interface
"""
import datetime as dt
from datetime import datetime
from typing import Any, Dict
import numpy as np
from . import config, data, mgmt
from .dates import days_map, units_rule
from .doc_sub import doc_sub, doc_sub_tx... | en | 0.469954 | interactive.py defines ipython archive interface pvname : string or list of strings, optional Pv or pvs to look up in the archiver. You can include glob wildcards in the pv name and we will look up all matching pvs. If not selected, we'll use the last pvname we looked up. {date_args} chunk : bool, optiona... | 3.063189 | 3 |
diamondkata_200217/diamond.py | cjhnim/daily-kata-python | 0 | 6628912 | class Diamond:
START_LETTER = 'A'
def __init__(self, upTo):
self.upTo = upTo
def show(self):
top = ''
bottom = ''
for c in range(ord(self.START_LETTER), ord(self.upTo)+1):
line = self.buildLine(chr(c))
top = self.buildTop(line, top)
... | class Diamond:
START_LETTER = 'A'
def __init__(self, upTo):
self.upTo = upTo
def show(self):
top = ''
bottom = ''
for c in range(ord(self.START_LETTER), ord(self.upTo)+1):
line = self.buildLine(chr(c))
top = self.buildTop(line, top)
... | none | 1 | 3.661435 | 4 | |
osh/bool_parse.py | ariabuckles/oil | 0 | 6628913 | <reponame>ariabuckles/oil<filename>osh/bool_parse.py<gh_stars>0
#!/usr/bin/env python
# Copyright 2016 <NAME>. 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://... | #!/usr/bin/env python
# Copyright 2016 <NAME>. 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
"""
bool_parse.py - Parse bo... | en | 0.698922 | #!/usr/bin/env python # Copyright 2016 <NAME>. 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 bool_parse.py - Parse boolea... | 2.784914 | 3 |
build/docs.py | wader/shaka-player | 1 | 6628914 | #!/usr/bin/python
#
# Copyright 2016 Google 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 ag... | #!/usr/bin/python
#
# Copyright 2016 Google 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 ag... | en | 0.8448 | #!/usr/bin/python # # Copyright 2016 Google 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 ag... | 2.085504 | 2 |
architecture_tool_django/modeling/signals.py | goldginkgo/architecture_tool_django | 1 | 6628915 | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Schema
from .tasks import schema_validation_task
@receiver(post_save, sender=Schema)
def schema_post_save_handler(sender, instance, created, **kwargs):
schema_validation_task.delay(instance.key)
| from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Schema
from .tasks import schema_validation_task
@receiver(post_save, sender=Schema)
def schema_post_save_handler(sender, instance, created, **kwargs):
schema_validation_task.delay(instance.key)
| none | 1 | 1.973365 | 2 | |
benchmarks/operator_benchmark/benchmark_core.py | stungkit/pytorch | 2 | 6628916 | import functools
import numpy as np
import timeit
import json
import torch
import copy
import ast
# needs to be imported after torch
import torch.utils.cpp_extension as cpp_extension # noqa: F401
import benchmark_utils
from collections import namedtuple
"""Performance microbenchmarks.
This module contains core fun... | import functools
import numpy as np
import timeit
import json
import torch
import copy
import ast
# needs to be imported after torch
import torch.utils.cpp_extension as cpp_extension # noqa: F401
import benchmark_utils
from collections import namedtuple
"""Performance microbenchmarks.
This module contains core fun... | en | 0.760557 | # needs to be imported after torch # noqa: F401 Performance microbenchmarks. This module contains core functionalities for performance microbenchmark tests. This is used to store configs of tests An example input is: TestConfig(test_name='add_M8_N2_K1', input_config='M: 8, N: 2, K: 1', tag='long', run_backward=Fal... | 2.487978 | 2 |
azure-devops/azext_devops/devops_sdk/v6_0/audit/audit_client.py | dhilmathy/azure-devops-cli-extension | 248 | 6628917 | <reponame>dhilmathy/azure-devops-cli-extension<gh_stars>100-1000
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --... | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | en | 0.631841 | # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------... | 2.054092 | 2 |
cdk-code/tests/test_static_website_stack.py | KMK-Git/kaustubhk | 0 | 6628918 | """
Test Static Website Stack.
"""
# pylint: disable=line-too-long
import aws_cdk as cdk
from aws_cdk import assertions
from application_stacks.static_website_stack import StaticWebsiteStack
def test_static_website_stack() -> None:
"""
Test Static Website Stack.
"""
app = cdk.App()
stack = Static... | """
Test Static Website Stack.
"""
# pylint: disable=line-too-long
import aws_cdk as cdk
from aws_cdk import assertions
from application_stacks.static_website_stack import StaticWebsiteStack
def test_static_website_stack() -> None:
"""
Test Static Website Stack.
"""
app = cdk.App()
stack = Static... | en | 0.640722 | Test Static Website Stack. # pylint: disable=line-too-long Test Static Website Stack. | 2.35971 | 2 |
test.py | abhimanoj/101-Days-Of-MLCode | 0 | 6628919 |
from utils import *
def test_error():
"""
raise exception..
"""
raise DataError("error is here")
"""
this will close the block here..
"""
try:
test_error()
except (DataError) as e:
print("errro",e)
|
from utils import *
def test_error():
"""
raise exception..
"""
raise DataError("error is here")
"""
this will close the block here..
"""
try:
test_error()
except (DataError) as e:
print("errro",e)
| en | 0.659761 | raise exception.. this will close the block here.. | 2.515329 | 3 |
catalyst/support/ccxt_issue_1358.py | guilhermeprokisch/catalyst | 0 | 6628920 | import ccxt
bitfinex = ccxt.bitfinex()
bitfinex.verbose = True
ohlcvs = bitfinex.fetch_ohlcv('ETH/BTC', '30m', 1504224000000)
dt = bitfinex.iso8601(ohlcvs[0][0])
print(dt) # should print '2017-09-01T00:00:00.000Z'
| import ccxt
bitfinex = ccxt.bitfinex()
bitfinex.verbose = True
ohlcvs = bitfinex.fetch_ohlcv('ETH/BTC', '30m', 1504224000000)
dt = bitfinex.iso8601(ohlcvs[0][0])
print(dt) # should print '2017-09-01T00:00:00.000Z'
| en | 0.419676 | # should print '2017-09-01T00:00:00.000Z' | 2.248142 | 2 |
qiskit_experiments/library/characterization/ef_spectroscopy.py | eliarbel/qiskit-experiments | 1 | 6628921 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | en | 0.786369 | # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo... | 2.426081 | 2 |
SLpackage/private/pacbio/pythonpkgs/pbcore/lib/python2.7/site-packages/pbcore/util/statistics.py | fanglab/6mASCOPE | 5 | 6628922 | <reponame>fanglab/6mASCOPE
import math
import numpy as np
class Constants(object):
MAX_QV = 60
def accuracy_as_phred_qv(accuracy, max_qv=Constants.MAX_QV):
"""
Convert fractional accuracy to Phred QV: 0.999 --> 30
returns: float or numpy array
"""
if isinstance(accuracy, (float, int)):
... | import math
import numpy as np
class Constants(object):
MAX_QV = 60
def accuracy_as_phred_qv(accuracy, max_qv=Constants.MAX_QV):
"""
Convert fractional accuracy to Phred QV: 0.999 --> 30
returns: float or numpy array
"""
if isinstance(accuracy, (float, int)):
assert 0 <= accuracy <... | en | 0.383677 | Convert fractional accuracy to Phred QV: 0.999 --> 30 returns: float or numpy array | 3.199331 | 3 |
mnelab/dialogs/findeventsdialog.py | rob-luke/mnelab | 156 | 6628923 | <gh_stars>100-1000
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from qtpy.QtWidgets import (QDialog, QVBoxLayout, QGridLayout, QLabel, QCheckBox, QSpinBox,
QDialogButtonBox, QComboBox)
MAX_INT = 2147483647
class FindEventsDialog(QDialog):
def __init__(self, parent, channe... | # Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from qtpy.QtWidgets import (QDialog, QVBoxLayout, QGridLayout, QLabel, QCheckBox, QSpinBox,
QDialogButtonBox, QComboBox)
MAX_INT = 2147483647
class FindEventsDialog(QDialog):
def __init__(self, parent, channels, default_stim):
... | en | 0.4752 | # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) | 1.997694 | 2 |
icarus_simulator/sat_core/orbit_util.py | RubenFr/ICARUS-framework | 5 | 6628924 | <reponame>RubenFr/ICARUS-framework
# 2020 <NAME> and <NAME>
from datetime import datetime, timedelta
import ephem
import numpy as np
from .planetary_const import *
def right_ascension_ascending_node(orbit_idx: int, num_orbits: int) -> ephem.Angle:
"""Compute the right ascension of the ascending node (raan).
... | # 2020 <NAME> and <NAME>
from datetime import datetime, timedelta
import ephem
import numpy as np
from .planetary_const import *
def right_ascension_ascending_node(orbit_idx: int, num_orbits: int) -> ephem.Angle:
"""Compute the right ascension of the ascending node (raan).
Args:
orbit_idx: Index ... | en | 0.792939 | # 2020 <NAME> and <NAME> Compute the right ascension of the ascending node (raan). Args: orbit_idx: Index of the orbit for which the raan is computed. num_orbits: Number of orbits in the constellation. Returns: ephem.Angle: The raan in degrees. Compute the mean anomaly for the current... | 3.253297 | 3 |
tests/test_iiasa.py | mabudz/pyam | 2 | 6628925 | <filename>tests/test_iiasa.py
import os
import pytest
import pandas as pd
import numpy as np
import numpy.testing as npt
import pandas.testing as pdt
from pyam import IamDataFrame, iiasa, read_iiasa, META_IDX
from pyam.testing import assert_iamframe_equal
from .conftest import IIASA_UNAVAILABLE, META_COLS, TEST_API,... | <filename>tests/test_iiasa.py
import os
import pytest
import pandas as pd
import numpy as np
import numpy.testing as npt
import pandas.testing as pdt
from pyam import IamDataFrame, iiasa, read_iiasa, META_IDX
from pyam.testing import assert_iamframe_equal
from .conftest import IIASA_UNAVAILABLE, META_COLS, TEST_API,... | en | 0.795477 | # check to see if we can do online testing of db authentication # connecting to an unknown API raises an error # connecting to an unknown API raises an error # connecting with invalid credentials raises an error # check that connection returns the correct variables # check that connection returns the correct regions [ ... | 2.156795 | 2 |
sanitychecks/basic_shape_dataset2d.py | Chumbyte/DiGS | 0 | 6628926 | # <NAME> (Itzik) <<EMAIL>>
# <NAME> <<EMAIL>>
import torch.utils.data as data
import numpy as np
import scipy.spatial as spatial
import utils.visualizations as vis
from abc import ABC, abstractmethod
from matplotlib.path import Path
import torch
class BasicShape2D(data.Dataset):
# A class to generate synthetic ex... | # <NAME> (Itzik) <<EMAIL>>
# <NAME> <<EMAIL>>
import torch.utils.data as data
import numpy as np
import scipy.spatial as spatial
import utils.visualizations as vis
from abc import ABC, abstractmethod
from matplotlib.path import Path
import torch
class BasicShape2D(data.Dataset):
# A class to generate synthetic ex... | en | 0.773691 | # <NAME> (Itzik) <<EMAIL>> # <NAME> <<EMAIL>> # A class to generate synthetic examples of basic shapes. # Generates clean and noisy point clouds sampled on Jets + samples no a grid with their distance to the surface #grid | gaussian | combined # Generate shape # generate grid points and find distance to closest point o... | 2.688491 | 3 |
web/web_tracker/migrations/0014_auto_20180905_0016.py | igorxxl8/Calistra | 0 | 6628927 | <reponame>igorxxl8/Calistra
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-09-04 21:16
from __future__ import unicode_literals
from django.db import migrations, models
import web_tracker.validators
class Migration(migrations.Migration):
dependencies = [
('web_tracker', '0013_auto_20180905_00... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-09-04 21:16
from __future__ import unicode_literals
from django.db import migrations, models
import web_tracker.validators
class Migration(migrations.Migration):
dependencies = [
('web_tracker', '0013_auto_20180905_0011'),
]
operations ... | en | 0.658481 | # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-09-04 21:16 | 1.749299 | 2 |
io_scene_xray/dm/ops.py | clayne/blender-xray | 0 | 6628928 | <gh_stars>0
# standart modules
import os
# blender modules
import bpy
import bpy_extras
# addon modules
from . import imp
from . import exp
from .. import contexts
from .. import icons
from .. import log
from .. import utils
from .. import ie_props
from .. import version_utils
class ImportDmContext(contexts.ImportM... | # standart modules
import os
# blender modules
import bpy
import bpy_extras
# addon modules
from . import imp
from . import exp
from .. import contexts
from .. import icons
from .. import log
from .. import utils
from .. import ie_props
from .. import version_utils
class ImportDmContext(contexts.ImportMeshContext):... | en | 0.063826 | # standart modules # blender modules # addon modules | 1.956119 | 2 |
examples/fci/10-spin.py | gmwang18/pyscf | 0 | 6628929 | #!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Assign spin state for FCI wavefunction.
By default, the FCI solver will take Mole attribute spin for the spin state.
It can be overwritten by passing kwarg ``nelec`` to the kernel function of FCI
solver. The nelec argument is a two-element tuple. The first is... | #!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Assign spin state for FCI wavefunction.
By default, the FCI solver will take Mole attribute spin for the spin state.
It can be overwritten by passing kwarg ``nelec`` to the kernel function of FCI
solver. The nelec argument is a two-element tuple. The first is... | en | 0.731974 | #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # Assign spin state for FCI wavefunction. By default, the FCI solver will take Mole attribute spin for the spin state. It can be overwritten by passing kwarg ``nelec`` to the kernel function of FCI solver. The nelec argument is a two-element tuple. The first is the ... | 2.681807 | 3 |
power/coding-challenges/leetcode/217-contains-duplicate.py | TuxedoMeow/Hello-World | 0 | 6628930 | <filename>power/coding-challenges/leetcode/217-contains-duplicate.py
"""
Notes:
Check if the list contains a duplicate or not.
"""
class Solution:
def contains_duplicate1(self, nums: [int]) -> bool:
nums.sort()
for index in range(len(nums)-1):
if nums[index] == nums[index+1]:
... | <filename>power/coding-challenges/leetcode/217-contains-duplicate.py
"""
Notes:
Check if the list contains a duplicate or not.
"""
class Solution:
def contains_duplicate1(self, nums: [int]) -> bool:
nums.sort()
for index in range(len(nums)-1):
if nums[index] == nums[index+1]:
... | en | 0.644143 | Notes: Check if the list contains a duplicate or not. # Time complexity: O(n^2) # Space complexity: O(1) contains_duplicate(): True contains_duplicate(): False contains_duplicate(): True contains_duplicate(): False Time complexity: O(n log n). Due to sorting time complexity will always add O(n log n). Space complexity... | 4.011123 | 4 |
pola/logic.py | KlubJagiellonski/pola-backend | 30 | 6628931 | <gh_stars>10-100
import locale
import re
from django.conf import settings
from company.models import Brand, Company
from pola import produkty_w_sieci_api
from pola.produkty_w_sieci_api import Client, is_code_supported_by_gs1_api
from product.models import Product
from report.models import Report
def get_result_from... | import locale
import re
from django.conf import settings
from company.models import Brand, Company
from pola import produkty_w_sieci_api
from pola.produkty_w_sieci_api import Client, is_code_supported_by_gs1_api
from product.models import Product
from report.models import Report
def get_result_from_code(code, multi... | en | 0.914063 | # code is EAN8 or EAN13 # not an EAN8 nor EAN13 code. Probably QR code or some error # we don't know the manufacturer # the code is registered in Poland, we want more data! # this is an ISBN/ISSN/ISMN number # (book, music album or magazine) # let's try to associate the code with a country # Ups. It seems to be an inte... | 1.949825 | 2 |
oct-qiskit-pulse/src/qoc_instruction_schedule_map.py | brosand/qiskit-terra | 0 | 6628932 | <gh_stars>0
from collections import defaultdict
from typing import Tuple, Iterable, Union
from qiskit import schedule, pulse
from qiskit.circuit import Gate
from qiskit.pulse import Play, Acquire
from qiskit.pulse.instruction_schedule_map import InstructionScheduleMap
from qiskit.pulse.schedule import Schedule
cla... | from collections import defaultdict
from typing import Tuple, Iterable, Union
from qiskit import schedule, pulse
from qiskit.circuit import Gate
from qiskit.pulse import Play, Acquire
from qiskit.pulse.instruction_schedule_map import InstructionScheduleMap
from qiskit.pulse.schedule import Schedule
class QOCInstru... | en | 0.682232 | # FIXME don't use protected member # self._new_map = # TODO figure out type hints for gate below Return the defined :py:class:`~qiskit.pulse.Schedule` for the given instruction on the given qubits. Args: instruction: Name of the instruction. qubits: The qubits for the instructio... | 2.492472 | 2 |
examples/paths.py | NicolasGensollen/streamfig | 0 | 6628933 | from Drawing import *
s = Drawing()
s.addColor("grey", "#BBBBBB")
s.addColor("white", "#FFFFFF")
s.addColor("red", "#ff0000")
s.addNode("a", [(0,10)])
s.addNode("b", [(0,4),(5,10)])
s.addNode("c", [(4,9)])
s.addNode("d", [(1,3)])
s.addLink("a","b",1,3)
s.addLink("a","b",7,8)
s.addLink("b","c",6,9)
s.addLink("b","d"... | from Drawing import *
s = Drawing()
s.addColor("grey", "#BBBBBB")
s.addColor("white", "#FFFFFF")
s.addColor("red", "#ff0000")
s.addNode("a", [(0,10)])
s.addNode("b", [(0,4),(5,10)])
s.addNode("c", [(4,9)])
s.addNode("d", [(1,3)])
s.addLink("a","b",1,3)
s.addLink("a","b",7,8)
s.addLink("b","c",6,9)
s.addLink("b","d"... | none | 1 | 2.55449 | 3 | |
Chapter7_CNN/Chapter7_3_CNN_Optimization/cnnNormAugment.py | thisisjako/UdemyTF | 0 | 6628934 | import os
from typing import Tuple
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Input
from tensorflow... | import os
from typing import Tuple
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Input
from tensorflow... | none | 1 | 2.854217 | 3 | |
train.py | Kash6/AnimeBot | 0 | 6628935 | <filename>train.py
#Train function
def train():
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(device)
# Config
batch_size = 4
image_size = 256
learning_rate = 1e-3
beta1, beta2 = (.5, .99)
weight_decay = 1e-3
epochs = 100
# Models
n... | <filename>train.py
#Train function
def train():
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(device)
# Config
batch_size = 4
image_size = 256
learning_rate = 1e-3
beta1, beta2 = (.5, .99)
weight_decay = 1e-3
epochs = 100
# Models
n... | en | 0.548263 | #Train function # Config # Models # Labels # Loss functions # Dataloaders # --------------------------------------------------------------------------------------------- # # Training Loop # Lists to keep track of progress" # For each epoch. # Format batch. # Generate image # Forward pass all batches through D. #.view(-... | 2.472012 | 2 |
cadnano/extras/wrapapi.py | mctrinh/cadnano2.5 | 69 | 6628936 | import inspect
from types import FunctionType
def getPublicMethods(cls):
return [(x, y) for x, y in cls.__dict__.items()
if (isinstance(y, FunctionType) and not x.startswith('_'))
]
# end def
def copyWrapAPI(cls_from, cls_to, attr_str='model'):
"""Use same `eval` trick as decorator m... | import inspect
from types import FunctionType
def getPublicMethods(cls):
return [(x, y) for x, y in cls.__dict__.items()
if (isinstance(y, FunctionType) and not x.startswith('_'))
]
# end def
def copyWrapAPI(cls_from, cls_to, attr_str='model'):
"""Use same `eval` trick as decorator m... | en | 0.394074 | # end def Use same `eval` trick as decorator module on PyPi to match function signatures see also: https://emptysqua.re/blog/copying-a-python-functions-signature/ But this supports type annotations too now maybe try to use functools.update_wrapper in the future # 1. Copy call signature Python 3 only u... | 2.466385 | 2 |
raybot/actions/messages.py | Zverik/bot_na_rayone | 32 | 6628937 | <reponame>Zverik/bot_na_rayone
from raybot import config
from raybot.bot import bot
from raybot.util import get_user, tr
from raybot.model import db
from asyncio import sleep
from aiogram import types
async def broadcast(message: types.Message):
mods = [config.ADMIN] + (await db.get_role_users('moderator'))
f... | from raybot import config
from raybot.bot import bot
from raybot.util import get_user, tr
from raybot.model import db
from asyncio import sleep
from aiogram import types
async def broadcast(message: types.Message):
mods = [config.ADMIN] + (await db.get_role_users('moderator'))
for user_id in mods:
awa... | en | 0.909027 | # Notify other moderators that it has been replied # TODO: can we do it just once per user? | 2.33035 | 2 |
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/views.py | bahattincinic/cookiecutter-apistar | 2 | 6628938 | from apistar import Response
from apistar.backends.sqlalchemy_backend import Session
from .models import Example
from .schema import ExampleCreate, ExampleList
def list_view(session: Session) -> Response:
return Response(content=[
ExampleList(item)
for item in session.query(Example).all()
])
... | from apistar import Response
from apistar.backends.sqlalchemy_backend import Session
from .models import Example
from .schema import ExampleCreate, ExampleList
def list_view(session: Session) -> Response:
return Response(content=[
ExampleList(item)
for item in session.query(Example).all()
])
... | none | 1 | 2.506975 | 3 | |
aasaan/aasaan/urls.py | deepakkt/aasaan | 0 | 6628939 | <reponame>deepakkt/aasaan<filename>aasaan/aasaan/urls.py
import contacts.urls
import travels.urls
import ipcaccounts.urls
import schedulemaster.urls
from django.contrib import admin
from django.urls import include, path
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static impor... | import contacts.urls
import travels.urls
import ipcaccounts.urls
import schedulemaster.urls
from django.contrib import admin
from django.urls import include, path
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from api.aasaan_api import (ScheduleResource, Zo... | none | 1 | 1.808372 | 2 | |
sympy/core/tests/test_random.py | utkarshdeorah/sympy | 1 | 6628940 | <reponame>utkarshdeorah/sympy
import random
from sympy.core.symbol import Symbol, symbols
from sympy.functions.elementary.trigonometric import sin, acos
from sympy.abc import x
def test_random():
random.seed(42)
a = random.random()
random.seed(42)
Symbol('z').is_finite
b = random.random()
asser... | import random
from sympy.core.symbol import Symbol, symbols
from sympy.functions.elementary.trigonometric import sin, acos
from sympy.abc import x
def test_random():
random.seed(42)
a = random.random()
random.seed(42)
Symbol('z').is_finite
b = random.random()
assert a == b
got = set()
... | none | 1 | 3.204187 | 3 | |
test-mq.py | yuyongpeng/raspberrypi | 0 | 6628941 | # -*- coding:UTF-8 -*-
import time
import os
import commands
import subprocess
import pika
parameters = pika.URLParameters('amqp://hardchain:pswHd@localhost:5672/%2F')
connection = pika.BlockingConnection(parameters)
channelr = connection.channel()
#声明queue
channelr.queue_declare(queue='electron3', durable=False) #... | # -*- coding:UTF-8 -*-
import time
import os
import commands
import subprocess
import pika
parameters = pika.URLParameters('amqp://hardchain:pswHd@localhost:5672/%2F')
connection = pika.BlockingConnection(parameters)
channelr = connection.channel()
#声明queue
channelr.queue_declare(queue='electron3', durable=False) #... | en | 0.528594 | # -*- coding:UTF-8 -*- #声明queue # 若声明过,则换一个名字 #n RabbitMQ a message can never be sent directly to the queue, it always needs to go through an exchange. # make message persistent | 2.662588 | 3 |
pynailgun/test_ng.py | mwhittaker/nailgun | 0 | 6628942 | import subprocess
import os
import time
import unittest
import tempfile
import shutil
import uuid
import sys
from pynailgun import NailgunException, NailgunConnection
is_py2 = sys.version[0] == '2'
if is_py2:
from StringIO import StringIO
else:
from io import StringIO
if os.name == 'posix':
def transport... | import subprocess
import os
import time
import unittest
import tempfile
import shutil
import uuid
import sys
from pynailgun import NailgunException, NailgunConnection
is_py2 = sys.version[0] == '2'
if is_py2:
from StringIO import StringIO
else:
from io import StringIO
if os.name == 'posix':
def transport... | en | 0.917393 | # on windows os.path.exists doen't allow to check reliably that a pipe exists # (os.path.exists tries to open connection to a pipe) # Close any open file descriptors to further separate buckd from its # invoking context (e.g. otherwise we'd hang when running things like # `ssh localhost buck clean`). # https://msdn.mic... | 2.112868 | 2 |
_scrap/_naver_stock.py | hopelife/mp_scraper | 0 | 6628943 | <reponame>hopelife/mp_scraper<gh_stars>0
import os, sys
import math
import copy
import time
from datetime import datetime
import re
# import requests
import urllib
import lxml.html as ht
# import lxml.etree as et
##------------------------------------------------------------
sys.path.append(os.path.join(os.path.dirna... | import os, sys
import math
import copy
import time
from datetime import datetime
import re
# import requests
import urllib
import lxml.html as ht
# import lxml.etree as et
##------------------------------------------------------------
sys.path.append(os.path.join(os.path.dirname(__file__), '../_public')) ## Note: 현재 ... | ko | 0.242533 | # import requests # import lxml.etree as et ##------------------------------------------------------------ ## Note: 현재 디렉토리 기준 상대 경로 설정 # sys.path.append(os.path.join(os.path.abspath('../staff'))) # from ScrapBySelenium import ScrapBySelenium ## ##---------------------------------------------------------- shcode의 종목에 대... | 2.473153 | 2 |
data/train/python/16b9d2b0b3e3ea014120236fc6a289879ecb9b64repositorymap.py | harshp8l/deep-learning-lang-detection | 84 | 6628944 | <gh_stars>10-100
#
# Copyright 2012 SAS Institute
#
# 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... | #
# Copyright 2012 SAS Institute
#
# 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 ... | en | 0.819848 | # # Copyright 2012 SAS Institute # # 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 ... | 2.065977 | 2 |
qiime2/metadata/io.py | lizgehret/qiime2 | 0 | 6628945 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | en | 0.764603 | # ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------... | 1.872986 | 2 |
examples/sync.py | DocRaptor/docraptor-python | 16 | 6628946 | <filename>examples/sync.py
# This example demonstrates creating a PDF using common options and saving it
# to a place on the filesystem.
#
# It is created synchronously, which means DocRaptor will render it for up to
# 60 seconds. It is slightly simpler than making documents using the async
# interface but making many ... | <filename>examples/sync.py
# This example demonstrates creating a PDF using common options and saving it
# to a place on the filesystem.
#
# It is created synchronously, which means DocRaptor will render it for up to
# 60 seconds. It is slightly simpler than making documents using the async
# interface but making many ... | en | 0.730424 | # This example demonstrates creating a PDF using common options and saving it # to a place on the filesystem. # # It is created synchronously, which means DocRaptor will render it for up to # 60 seconds. It is slightly simpler than making documents using the async # interface but making many documents in parallel or ve... | 3.16819 | 3 |
cell-painting/1.optimize/scripts/get_best_hyperparametersLEVEL5.py | gwaygenomics/cell-painting-vae | 3 | 6628947 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
import os
import json
vis_datas = []
layers = ['onelayer','twolayer','threelayer']
for layer in layers:
vis_data = []
rootdir = 'parameter_sweepLEVEL5/' + layer
for subdirs, dirs, files in os.walk(rootdir):
for file in files:
if file.end... | #!/usr/bin/env python
# coding: utf-8
# In[2]:
import os
import json
vis_datas = []
layers = ['onelayer','twolayer','threelayer']
for layer in layers:
vis_data = []
rootdir = 'parameter_sweepLEVEL5/' + layer
for subdirs, dirs, files in os.walk(rootdir):
for file in files:
if file.end... | en | 0.187926 | #!/usr/bin/env python # coding: utf-8 # In[2]: # In[6]: # In[5]: # In[6]: # In[ ]: | 2.202685 | 2 |
4/tests.py | offbyoni/adventOfCode2017 | 0 | 6628948 | import unittest
import passphraseChecker
class advent4Test(unittest.TestCase):
def test_checkInValidphrase(self):
passphrase = "<PASSWORD>"
self.assertFalse(passphraseChecker.checkPhraseValid(passphrase))
def test_checkValidPassphrase(self):
passphrase = "<PASSWORD>"
self.asser... | import unittest
import passphraseChecker
class advent4Test(unittest.TestCase):
def test_checkInValidphrase(self):
passphrase = "<PASSWORD>"
self.assertFalse(passphraseChecker.checkPhraseValid(passphrase))
def test_checkValidPassphrase(self):
passphrase = "<PASSWORD>"
self.asser... | none | 1 | 3.513349 | 4 | |
direct/launch.py | NKI-AI/direct | 57 | 6628949 | <gh_stars>10-100
# coding=utf-8
# Copyright (c) DIRECT Contributors
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Taken from Detectron 2, licensed under Apache 2.0.
# https://github.com/facebookresearch/detectron2/blob/903d28b63c02dffc81935a38a85ab5a16450a445/detectron2/engine/launch.py
# Ch... | # coding=utf-8
# Copyright (c) DIRECT Contributors
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Taken from Detectron 2, licensed under Apache 2.0.
# https://github.com/facebookresearch/detectron2/blob/903d28b63c02dffc81935a38a85ab5a16450a445/detectron2/engine/launch.py
# Changes:
# - Docstr... | en | 0.735305 | # coding=utf-8 # Copyright (c) DIRECT Contributors # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Taken from Detectron 2, licensed under Apache 2.0. # https://github.com/facebookresearch/detectron2/blob/903d28b63c02dffc81935a38a85ab5a16450a445/detectron2/engine/launch.py # Changes: # - Docstri... | 2.07075 | 2 |
db_manage/mysql_config.py | JX-Wang/obtaining_domain_valid_dns | 1 | 6628950 | <gh_stars>1-10
# encoding:utf-8
"""
数据库配置文件
"""
# 本地数据库
SOURCE_CONFIG_LOCAL = {
'host': '10.245.146.39',
'port': 3306,
'user': 'root',
'passwd': '<PASSWORD>',
'db': 'domain_valid_dns',
'charset': 'utf8',
'use_unicode': True
}
| # encoding:utf-8
"""
数据库配置文件
"""
# 本地数据库
SOURCE_CONFIG_LOCAL = {
'host': '10.245.146.39',
'port': 3306,
'user': 'root',
'passwd': '<PASSWORD>',
'db': 'domain_valid_dns',
'charset': 'utf8',
'use_unicode': True
} | zh | 0.974329 | # encoding:utf-8 数据库配置文件 # 本地数据库 | 1.303624 | 1 |