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 |
|---|---|---|---|---|---|---|---|---|---|---|
3-factor-model.py | VincentGaoHJ/Fama-French-3-Factor-Model | 9 | 6627951 | # -*- coding: utf-8 -*-
"""
@Date: Created on Tue Apr 9 01:01:00 2019
@Author: <NAME>
@Description: Fama-French 3-factor model
首先直观感受三因子模型的有效性:
按照市值分成五组,感受市值与收益率关系
按照账面市值比分成五组,感受账面市值比与收益率关系
按照市值和账面市值比分成二十五组,感受两个因子与收益率关系
"""
import pandas as pd
class Portafolio(object):
"""
创建组合的类... | # -*- coding: utf-8 -*-
"""
@Date: Created on Tue Apr 9 01:01:00 2019
@Author: <NAME>
@Description: Fama-French 3-factor model
首先直观感受三因子模型的有效性:
按照市值分成五组,感受市值与收益率关系
按照账面市值比分成五组,感受账面市值比与收益率关系
按照市值和账面市值比分成二十五组,感受两个因子与收益率关系
"""
import pandas as pd
class Portafolio(object):
"""
创建组合的类... | zh | 0.665858 | # -*- coding: utf-8 -*- @Date: Created on Tue Apr 9 01:01:00 2019 @Author: <NAME> @Description: Fama-French 3-factor model 首先直观感受三因子模型的有效性: 按照市值分成五组,感受市值与收益率关系 按照账面市值比分成五组,感受账面市值比与收益率关系 按照市值和账面市值比分成二十五组,感受两个因子与收益率关系 创建组合的类 idnum [组合的代号 00-44(str)] num [组合所包含的数据的条目数量(int)] rank_M... | 2.769933 | 3 |
sponge-integration-tests/examples/core/processors_metadata_enhanced.py | mnpas/sponge | 9 | 6627952 | """
Sponge Knowledge Base
Processors enhanced metadata
"""
class EdvancedMetaAction(Action):
def onConfigure(self):
self.withFeatures({"isVisibleMethod":"isVisible"})
def onCall(self, text):
return text.upper()
def isVisible(self, context):
return context == "day"
| """
Sponge Knowledge Base
Processors enhanced metadata
"""
class EdvancedMetaAction(Action):
def onConfigure(self):
self.withFeatures({"isVisibleMethod":"isVisible"})
def onCall(self, text):
return text.upper()
def isVisible(self, context):
return context == "day"
| en | 0.624775 | Sponge Knowledge Base
Processors enhanced metadata | 2.16426 | 2 |
app/okex/client.py | lanzhizhuxia/orange-tuiles | 0 | 6627953 | import requests
import json
from . import consts as c, utils, exceptions
class Client(object):
def __init__(self, api_key, api_secret_key, passphrase, use_server_time=False, test=False, first=False):
self.API_KEY = api_key
self.API_SECRET_KEY = api_secret_key
self.PASSPHRASE = passphrase... | import requests
import json
from . import consts as c, utils, exceptions
class Client(object):
def __init__(self, api_key, api_secret_key, passphrase, use_server_time=False, test=False, first=False):
self.API_KEY = api_key
self.API_SECRET_KEY = api_secret_key
self.PASSPHRASE = passphrase... | zh | 0.160722 | # url # 获取本地时间 # sign & header # 获取服务器时间 # print("headers:", header) # send request # exception handle | 2.853435 | 3 |
src/Display/avt_window.py | schmouk/ArcheryVideoTraining | 0 | 6627954 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2021 <NAME>
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 without limitation the rights
to use... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2021 <NAME>
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 without limitation the rights
to use... | en | 0.741395 | #!/usr/bin/env python # -*- coding: utf-8 -*- Copyright (c) 2021 <NAME> 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 without limitation the rights to use, c... | 1.512177 | 2 |
SVM.py | hishamzargar/test | 0 | 6627955 | import pickle
import matplotlib.pyplot as plt
from sklearn.svm import SVC, LinearSVC
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import classification_report, confusion_matrix
import numpy as np
import scikitplot as skplt
# Opening the files about data
X = pickle.load(open("X_train.pickle", "r... | import pickle
import matplotlib.pyplot as plt
from sklearn.svm import SVC, LinearSVC
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import classification_report, confusion_matrix
import numpy as np
import scikitplot as skplt
# Opening the files about data
X = pickle.load(open("X_train.pickle", "r... | en | 0.701174 | # Opening the files about data # normalizing data (a pixel goes from 0 to 255) for faster recognition #reshaping the numpy array from 4D to 2D to fit in SVM classifier #training the data #predicting the data #output metrics #Ploting the confusion matrix with scikitplot library | 3.196096 | 3 |
tests/2019/test_24_planet_of_discord.py | wimglenn/advent-of-code-wim | 20 | 6627956 | <filename>tests/2019/test_24_planet_of_discord.py
from aoc_wim.aoc2019 import q24
test_bugs = """\
....#
#..#.
#..##
..#..
#....
"""
def test_example_b():
result = q24.part_b(test_bugs, t=10)
assert result == 99
| <filename>tests/2019/test_24_planet_of_discord.py
from aoc_wim.aoc2019 import q24
test_bugs = """\
....#
#..#.
#..##
..#..
#....
"""
def test_example_b():
result = q24.part_b(test_bugs, t=10)
assert result == 99
| en | 0.312578 | \ ....# #..#. #..## ..#.. #.... | 1.52939 | 2 |
mpa/modules/datasets/task_adapt_dataset.py | openvinotoolkit/model_preparation_algorithm | 0 | 6627957 | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from mmdet.datasets import PIPELINES, DATASETS, build_dataset
# import torch
import numpy as np
from mpa.modules.utils.task_adapt import map_class_names, map_cat_and_cls_as_order
@DATASETS.register_module()
class TaskAdaptEvalDataset(obj... | # Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from mmdet.datasets import PIPELINES, DATASETS, build_dataset
# import torch
import numpy as np
from mpa.modules.utils.task_adapt import map_class_names, map_cat_and_cls_as_order
@DATASETS.register_module()
class TaskAdaptEvalDataset(obj... | en | 0.63818 | # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # import torch Dataset wrapper for task-adative evaluation. # Filter & reorder detection results # for each image # for each class # Gather per-class results according to index mapping # Call evaluation w/ org arguments Data processor for ta... | 2.05399 | 2 |
goto2_timing.py | ArtUshak/gotoHackBlitz | 0 | 6627958 | <reponame>ArtUshak/gotoHackBlitz
import time
events = []
steps = []
def register_event_data(user_id, action, step_id, time):
global events
events += [{'user_id':user_id, 'action':action, 'step_id':step_id, 'time':time}]
def register_step_data(step_id, module_position, lesson_position, step_position)... | import time
events = []
steps = []
def register_event_data(user_id, action, step_id, time):
global events
events += [{'user_id':user_id, 'action':action, 'step_id':step_id, 'time':time}]
def register_step_data(step_id, module_position, lesson_position, step_position):
global steps
steps +=... | none | 1 | 2.649255 | 3 | |
treecorr/ggcorrelation.py | zchvsre/TreeCorr | 0 | 6627959 | <reponame>zchvsre/TreeCorr<filename>treecorr/ggcorrelation.py<gh_stars>0
# Copyright (c) 2003-2019 by <NAME>
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source ... | # Copyright (c) 2003-2019 by <NAME>
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions... | en | 0.745584 | # Copyright (c) 2003-2019 by <NAME> # # TreeCorr is free software: redistribution and use in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions... | 2.391111 | 2 |
arelle/plugin/logging/dpmSignature.py | theredpea/Arelle | 1 | 6627960 | '''
Created on Dec 12, 2013
@author: Mark V Systems Limited
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
from arelle.ModelDtsObject import ModelConcept
from arelle.ModelInstanceObject import ModelFact
from arelle.XmlUtil import xmlstring
# key for use in dFact only when there's a dim that behav... | '''
Created on Dec 12, 2013
@author: Mark V Systems Limited
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
from arelle.ModelDtsObject import ModelConcept
from arelle.ModelInstanceObject import ModelFact
from arelle.XmlUtil import xmlstring
# key for use in dFact only when there's a dim that behav... | en | 0.818867 | Created on Dec 12, 2013 @author: Mark V Systems Limited (c) Copyright 2013 Mark V Systems Limited, All rights reserved. # key for use in dFact only when there's a dim that behaves as or is typed # arg may be a ModelFact, or any other ModelObject # signature may be passed in as arg for non-fact error # Do not use _( ) ... | 1.79678 | 2 |
doc/examples/cookbook/wave_stab.py | markendr/esys-escript.github.io | 0 | 6627961 | <reponame>markendr/esys-escript.github.io<gh_stars>0
##############################################################################
#
# Copyright (c) 2009-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://ww... | ##############################################################################
#
# Copyright (c) 2009-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unti... | en | 0.578654 | ############################################################################## # # Copyright (c) 2009-2018 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # # Development unti... | 1.827083 | 2 |
examples/dialogpt_medium.py | ibivibiv/openchat | 0 | 6627962 | from openchat import OpenChat
if __name__ == '__main__':
OpenChat(model="dialogpt.medium", device="cuda") | from openchat import OpenChat
if __name__ == '__main__':
OpenChat(model="dialogpt.medium", device="cuda") | none | 1 | 1.527873 | 2 | |
lib/spack/spack/cmd/fetch.py | xiki-tempula/spack | 2 | 6627963 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import spack.cmd
import spack.cmd.common.arguments as arguments
import spack.config
import sp... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import spack.cmd
import spack.cmd.common.arguments as arguments
import spack.config
import sp... | en | 0.786292 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # Skip already-installed packages with --missing # Do not attempt to fetch externals (they're local) | 2.214219 | 2 |
gamer/models/core.py | sirfoga/gamer | 0 | 6627964 | <filename>gamer/models/core.py
# !/usr/bin/python2
# coding: utf-8
""" GAME models """
import json
import os
import shutil
import time
from multiprocessing import Process
from game.models import Game, FilesConfig, LabelsConfig
from gamer.config import OUTPUT_FOLDER, PROCESSES_COUNT
from gamer.emails.mailer import n... | <filename>gamer/models/core.py
# !/usr/bin/python2
# coding: utf-8
""" GAME models """
import json
import os
import shutil
import time
from multiprocessing import Process
from game.models import Game, FilesConfig, LabelsConfig
from gamer.config import OUTPUT_FOLDER, PROCESSES_COUNT
from gamer.emails.mailer import n... | en | 0.591168 | # !/usr/bin/python2 # coding: utf-8 GAME models Runs GAME models # todo check format, should be ['G0', 'N' ..] # todo check format, should be ['G0', 'N' ..] # todo debug file Config files for GAME models :param config_folder: str Path to config file :return: void Parses raw data # read and retur... | 2.480907 | 2 |
romanize/eng.py | markomanninen/abnum | 2 | 6627965 | <filename>romanize/eng.py
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# file: eng.py
import re
from collections import OrderedDict
from romanize.romanizer import romanizer
has_capitals = True
data = OrderedDict()
data['a'] = dict(letter=[u'a'], name=u'αλφα', segment='vowel', subsegment='short', transliteration=... | <filename>romanize/eng.py
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# file: eng.py
import re
from collections import OrderedDict
from romanize.romanizer import romanizer
has_capitals = True
data = OrderedDict()
data['a'] = dict(letter=[u'a'], name=u'αλφα', segment='vowel', subsegment='short', transliteration=... | en | 0.703684 | #!/usr/local/bin/python # -*- coding: utf-8 -*- # file: eng.py # collect letters from data dictionary for preprocessing function Preprocess string to transform all diacritics and remove other special characters :param string: :return: Swap characters from script to transliterated version and vice versa. ... | 2.881873 | 3 |
dash/figures.py | afo/covid19 | 3 | 6627966 | import json
import plotly
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pickle
import pandas as pd
import numpy as np
import utilities as utils
import constants as const
def plot_map(date_index, total, iva, death, mobility):
"""Generates the map in... | import json
import plotly
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pickle
import pandas as pd
import numpy as np
import utilities as utils
import constants as const
def plot_map(date_index, total, iva, death, mobility):
"""Generates the map in... | en | 0.669656 | Generates the map in the dashboard TODO(<EMAIL>) callbacks do no work currently. Needs to be inspected Arguments: date_index {int} -- index of the date used (from slider) total {Boolean} -- If to visualize: Confirmed cases iva {Boolean} -- If to visualize: Intensive care ... | 3.17056 | 3 |
python/taichi/aot/module.py | zstone12/taichi | 1 | 6627967 | from contextlib import contextmanager
from pathlib import Path, PurePosixPath
from taichi.lang import impl, kernel_impl
from taichi.lang.field import ScalarField
from taichi.lang.matrix import MatrixField
from taichi.type.annotations import ArgAnyArray, template
class KernelTemplate:
def __init__(self, kernel_fn... | from contextlib import contextmanager
from pathlib import Path, PurePosixPath
from taichi.lang import impl, kernel_impl
from taichi.lang.field import ScalarField
from taichi.lang.matrix import MatrixField
from taichi.type.annotations import ArgAnyArray, template
class KernelTemplate:
def __init__(self, kernel_fn... | en | 0.424763 | # kernel AOT An AOT module to save and load Taichi kernels. This module serializes the Taichi kernels for a specific arch. The serialized module can later be loaded to run on that backend, without the Python environment. Example: Usage:: m = ti.aot.Module(ti.metal) m.add_kernel(... | 2.019794 | 2 |
402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/cdk_aws_cookbook_402/cdk_aws_cookbook_402_stack.py | AWSCookbook/Databases | 6 | 6627968 | <reponame>AWSCookbook/Databases<filename>402-Using-IAM-Authentication-with-RDS/cdk-AWS-Cookbook-402/cdk_aws_cookbook_402/cdk_aws_cookbook_402_stack.py
from constructs import Construct
from aws_cdk import (
aws_ec2 as ec2,
aws_s3 as s3,
aws_s3_deployment,
aws_rds as rds,
aws_iam as iam,
Stack,
... | from constructs import Construct
from aws_cdk import (
aws_ec2 as ec2,
aws_s3 as s3,
aws_s3_deployment,
aws_rds as rds,
aws_iam as iam,
Stack,
CfnOutput,
RemovalPolicy
)
class CdkAwsCookbook402Stack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:... | en | 0.408306 | # create s3 bucket # create VPC # Find names with - aws ec2 describe-vpc-endpoint-services | jq '.ServiceNames' # Find names with - aws ec2 describe-vpc-endpoint-services | jq '.ServiceNames' # -------- Begin EC2 Helper --------- # Find names with - aws ec2 describe-vpc-endpoint-services | jq '.ServiceNames' # Find nam... | 1.925596 | 2 |
pydmga/container.py | robsontpm/BIOPHYS-cholesterol-association | 0 | 6627969 | <filename>pydmga/container.py
import geometry
import dmga2py
#TODO: make get_particles(subset = None) for Container
#TODO: dodac klasy reprezentujace kinetic_structure
class ContainerIterator:
'''
used to iterate over Container like::
for particle in container:
pass
:param container: Contain... | <filename>pydmga/container.py
import geometry
import dmga2py
#TODO: make get_particles(subset = None) for Container
#TODO: dodac klasy reprezentujace kinetic_structure
class ContainerIterator:
'''
used to iterate over Container like::
for particle in container:
pass
:param container: Contain... | en | 0.71894 | #TODO: make get_particles(subset = None) for Container #TODO: dodac klasy reprezentujace kinetic_structure used to iterate over Container like::
for particle in container:
pass
:param container: Container for iteration :return: self :return: next particle as a tuple of (id, x, y, z) This holds particles... | 2.974475 | 3 |
scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/python/version.py | awltux/scm-manager | 0 | 6627970 | <gh_stars>0
#
# Copyright (c) 2010, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condition... | #
# Copyright (c) 2010, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the fo... | en | 0.714628 | # # Copyright (c) 2010, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the fo... | 1.307606 | 1 |
tests/plugins/fail_htlcs.py | jooray/lightning | 1 | 6627971 | <reponame>jooray/lightning
#!/usr/bin/env python3
from lightning import Plugin
plugin = Plugin()
@plugin.hook("htlc_accepted")
def on_htlc_accepted(htlc, onion, plugin):
plugin.log("Failing htlc on purpose")
plugin.log("onion: %r" % (onion))
return {"result": "fail", "failure_code": 16399}
plugin.run(... | #!/usr/bin/env python3
from lightning import Plugin
plugin = Plugin()
@plugin.hook("htlc_accepted")
def on_htlc_accepted(htlc, onion, plugin):
plugin.log("Failing htlc on purpose")
plugin.log("onion: %r" % (onion))
return {"result": "fail", "failure_code": 16399}
plugin.run() | fr | 0.221828 | #!/usr/bin/env python3 | 2.004856 | 2 |
scipy_test.py | hustic/Armageddon | 0 | 6627972 | <filename>scipy_test.py<gh_stars>0
import numpy as np
from scipy.integrate import solve_ivp
import pandas as pd
def sci_sol(radius=10, velocity=20e3, density=3000, strength=10e5, angle=45, init_altitude=100e3, distance=0, dt=0.05, fragmentation=True, num_scheme='RK45', radians=False, C_D=1., C_H=0.1, Q=1e7, C_L=1e-3, ... | <filename>scipy_test.py<gh_stars>0
import numpy as np
from scipy.integrate import solve_ivp
import pandas as pd
def sci_sol(radius=10, velocity=20e3, density=3000, strength=10e5, angle=45, init_altitude=100e3, distance=0, dt=0.05, fragmentation=True, num_scheme='RK45', radians=False, C_D=1., C_H=0.1, Q=1e7, C_L=1e-3, ... | en | 0.678155 | Solves analytical solution for meteroid impact Parameters ---------- radius : float The radius of the asteroid in meters velocity : float The entery speed of the asteroid in meters/second density : float The density of the asteroid in kg/m^3 strength : float ... | 3.144808 | 3 |
unpack.py | ahrnbom/rabloromi | 1 | 6627973 | <filename>unpack.py
# You only need to run this once!
from pathlib import Path
from zipfile import ZipFile
cards_folder = Path('static') / 'cards'
def verify():
if not cards_folder.is_dir():
return False
files = [f for f in cards_folder.glob('*.png') if f.is_file()]
if len(files) >= 1:
return ... | <filename>unpack.py
# You only need to run this once!
from pathlib import Path
from zipfile import ZipFile
cards_folder = Path('static') / 'cards'
def verify():
if not cards_folder.is_dir():
return False
files = [f for f in cards_folder.glob('*.png') if f.is_file()]
if len(files) >= 1:
return ... | en | 0.925495 | # You only need to run this once! | 3.199125 | 3 |
install_compiler.py | ssrg-vt/mklinux-compiler | 0 | 6627974 | <filename>install_compiler.py<gh_stars>0
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import os, os.path
import shutil
import subprocess
import sys
import tarfile
import urllib
import multiprocessing
#================================================
# GLOBALS
#========================... | <filename>install_compiler.py<gh_stars>0
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import os, os.path
import shutil
import subprocess
import sys
import tarfile
import urllib
import multiprocessing
#================================================
# GLOBALS
#========================... | en | 0.322181 | #!/usr/bin/env python2 #================================================ # GLOBALS #================================================ # LLVM 3.7.1 SVN URL # Clang SVN URL # Binutils 2.27 URL #================================================ # LOG CLASS # Logs all output to outfile as well as stdout #==================... | 2.177704 | 2 |
internal/endtoend/testdata/emit_pydantic_models/postgresql/models.py | BearerPipelineTest/sqlc | 0 | 6627975 | # Code generated by sqlc. DO NOT EDIT.
# versions:
# sqlc v1.13.0
import pydantic
from typing import Optional
class Author(pydantic.BaseModel):
id: int
name: str
bio: Optional[str]
| # Code generated by sqlc. DO NOT EDIT.
# versions:
# sqlc v1.13.0
import pydantic
from typing import Optional
class Author(pydantic.BaseModel):
id: int
name: str
bio: Optional[str]
| en | 0.725095 | # Code generated by sqlc. DO NOT EDIT. # versions: # sqlc v1.13.0 | 2.247664 | 2 |
venv/Lib/site-packages/cryptography/hazmat/backends/openssl/dh.py | gilbertekalea/booking.com_crawler | 7 | 6627976 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
from cryptography.hazmat.primitives import serialization
from cryptogra... | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
from cryptography.hazmat.primitives import serialization
from cryptogra... | en | 0.862627 | # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. # In libressl DHparams_dup don't copy q # Invalid kex errors here in OpenSSL 3.0 because checks were moved # to EVP_PKEY_derive_set_peer # I... | 2.100029 | 2 |
brain/brain_libs/joint_model_fix/get_lu_pred.py | zuxfoucault/DoctorBot_demo | 0 | 6627977 | <filename>brain/brain_libs/joint_model_fix/get_lu_pred.py
# -*- coding: utf-8 -*-
"""
Get predicted intent and slot from user utterance.
"""
import tensorflow as tf
import sys
import os
import numpy as np
import jieba
import data_utils
import multi_task_model
DIR1 = "../brain/brain_libs/data_resource/"
DIR2 = "../"
... | <filename>brain/brain_libs/joint_model_fix/get_lu_pred.py
# -*- coding: utf-8 -*-
"""
Get predicted intent and slot from user utterance.
"""
import tensorflow as tf
import sys
import os
import numpy as np
import jieba
import data_utils
import multi_task_model
DIR1 = "../brain/brain_libs/data_resource/"
DIR2 = "../"
... | en | 0.661115 | # -*- coding: utf-8 -*- Get predicted intent and slot from user utterance. # Create vocabularies of the appropriate sizes. Create model and initialize or load parameters in session. # Get token-ids for the input sentence. # Decode from standard input. # Get token-ids for the input sentence. # Prepare one batch # Get pr... | 1.926158 | 2 |
setup.py | pymontecarlo/pypenelopetools | 3 | 6627978 | #!/usr/bin/env python
# Standard library modules.
import os
# Third party modules.
from setuptools import setup, find_packages
# Local modules.
import versioneer
# Globals and constants variables.
BASEDIR = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(BASEDIR, "README.md"), "r") as fp:
LON... | #!/usr/bin/env python
# Standard library modules.
import os
# Third party modules.
from setuptools import setup, find_packages
# Local modules.
import versioneer
# Globals and constants variables.
BASEDIR = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(BASEDIR, "README.md"), "r") as fp:
LON... | en | 0.389572 | #!/usr/bin/env python # Standard library modules. # Third party modules. # Local modules. # Globals and constants variables. | 1.511664 | 2 |
ec2api/tests/functional/api/test_vpn_gateways.py | vishnu-kumar/ec2-api | 0 | 6627979 | # Copyright 2014 OpenStack Foundation
# 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 requ... | # Copyright 2014 OpenStack Foundation
# 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 requ... | en | 0.845743 | # Copyright 2014 OpenStack Foundation # 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 requ... | 1.785381 | 2 |
anaconda_project/requirements_registry/requirements/download.py | kathatherine/anaconda-project | 188 | 6627980 | <filename>anaconda_project/requirements_registry/requirements/download.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The fu... | <filename>anaconda_project/requirements_registry/requirements/download.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The fu... | en | 0.795427 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, Anaconda, Inc. All rights reserved. # # Licensed under the terms of the BSD 3-Clause License. # The full license is in the file LICENSE.txt, distributed with this software. # -------------------... | 2.691685 | 3 |
.github/workflows/maturin_build_wheel.py | xkortex/blake3-py | 0 | 6627981 | <reponame>xkortex/blake3-py
#! /usr/bin/env python3
import os
import platform
import sys
from pathlib import Path
import subprocess
ROOT = Path(__file__).parent.parent.parent
# For macOS and Windows, we run Maturin against the Python interpreter that's
# been installed and configured for this CI run, i.e. the one th... | #! /usr/bin/env python3
import os
import platform
import sys
from pathlib import Path
import subprocess
ROOT = Path(__file__).parent.parent.parent
# For macOS and Windows, we run Maturin against the Python interpreter that's
# been installed and configured for this CI run, i.e. the one that's running
# this script. ... | en | 0.914729 | #! /usr/bin/env python3 # For macOS and Windows, we run Maturin against the Python interpreter that's # been installed and configured for this CI run, i.e. the one that's running # this script. (There are generally several versions installed by default, but # that's not guaranteed.) For Linux, in order to get "manylinu... | 2.277744 | 2 |
palettes/hues.py | maddisoj/wallgen | 0 | 6627982 | import imgen
import math
import random
# Generates colours whose hues are evenly distributed around the colour wheel.
# The saturation and lightness are the same for each colour with both being
# clamped to a subset to prevent murky colours.
class Palette(imgen.Palette):
def generate(self, **kwargs):
colo... | import imgen
import math
import random
# Generates colours whose hues are evenly distributed around the colour wheel.
# The saturation and lightness are the same for each colour with both being
# clamped to a subset to prevent murky colours.
class Palette(imgen.Palette):
def generate(self, **kwargs):
colo... | en | 0.94258 | # Generates colours whose hues are evenly distributed around the colour wheel. # The saturation and lightness are the same for each colour with both being # clamped to a subset to prevent murky colours. | 3.192552 | 3 |
src/user_auth_api/models.py | Adstefnum/mockexams | 0 | 6627983 | SUB_CHOICES = (
("ENG", "English"),
("MATH", "Mathematics"),
("PHY", "Physics"),
("GEO", "Geography"),
("BIO", "Biology"),
)
EXAM_TYPE = (
("UTME", "Jamb Examination"),
("POST-UTME", 'Post Jamb Examination'),
)
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from... | SUB_CHOICES = (
("ENG", "English"),
("MATH", "Mathematics"),
("PHY", "Physics"),
("GEO", "Geography"),
("BIO", "Biology"),
)
EXAM_TYPE = (
("UTME", "Jamb Examination"),
("POST-UTME", 'Post Jamb Examination'),
)
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from... | en | 0.541223 | # validators should be a list | 2.387641 | 2 |
look/views.py | scotthou94/myinstagram | 0 | 6627984 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.views.generic.edit import CreateView
from look.models import Follow
from look.models import Tweet
from django.contrib.auth.models import User
from stream_django.enrich import Enr... | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.views.generic.edit import CreateView
from look.models import Follow
from look.models import Tweet
from django.contrib.auth.models import User
from stream_django.enrich import Enr... | en | 0.833393 | #create a form instance from post data.the authenticated user is passed only the POST`s text field is needed #validate the form #save a new Tweet object from the form data #for a GET request, create a blank form #generating the user list #user himself shouldn't appear #not followed #followed #Timeline view #hashtag vie... | 2.19524 | 2 |
admin/api/wsgi.py | MAHDTech/babylon | 21 | 6627985 | #!/usr/bin/env python3
import flask
import json
import kubernetes
import os
import pathlib
import random
import re
import redis
import string
from hotfix import HotfixKubeApiClient
def random_string(length):
return ''.join([random.choice(string.ascii_letters + string.digits) for n in range(length)])
application... | #!/usr/bin/env python3
import flask
import json
import kubernetes
import os
import pathlib
import random
import re
import redis
import string
from hotfix import HotfixKubeApiClient
def random_string(length):
return ''.join([random.choice(string.ascii_letters + string.digits) for n in range(length)])
application... | en | 0.654642 | #!/usr/bin/env python3 # In development get user from authentication | 2.124988 | 2 |
engine/game_object/tests/test_game_object.py | codehearts/pickles-fetch-quest | 3 | 6627986 | from ..game_object import GameObject
from unittest.mock import Mock
import unittest
class TestGameObject(unittest.TestCase):
"""Test functionality of a event-drive game objects."""
def setUp(self):
"""Defines the following properties for each test case:
* self.on_move: Listener mock for on_m... | from ..game_object import GameObject
from unittest.mock import Mock
import unittest
class TestGameObject(unittest.TestCase):
"""Test functionality of a event-drive game objects."""
def setUp(self):
"""Defines the following properties for each test case:
* self.on_move: Listener mock for on_m... | en | 0.814603 | Test functionality of a event-drive game objects. Defines the following properties for each test case: * self.on_move: Listener mock for on_move. * self.on_move_relative: Listener mock for on_move_relative. * self.on_collider_enter: Listener mock for on_collider_enter. * self.game_objec... | 3.559931 | 4 |
tensorflow/contrib/learn/python/learn/utils/input_fn_utils.py | tianyapiaozi/tensorflow | 848 | 6627987 | # Copyright 2016 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... | # Copyright 2016 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... | en | 0.76672 | # Copyright 2016 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... | 1.413027 | 1 |
run.py | Kamnitsask/ssl_compact_clustering | 61 | 6627988 | #!/usr/bin/env python
# Copyright (c) 2018, <NAME>
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
# To see the help and options, in co... | #!/usr/bin/env python
# Copyright (c) 2018, <NAME>
#
# This program is free software; you can redistribute and/or modify
# it under the terms of the Apache License, Version 2.0. See the
# accompanying LICENSE file or read the terms at:
# http://www.apache.org/licenses/LICENSE-2.0
# To see the help and options, in co... | en | 0.638399 | #!/usr/bin/env python # Copyright (c) 2018, <NAME> # # This program is free software; you can redistribute and/or modify # it under the terms of the Apache License, Version 2.0. See the # accompanying LICENSE file or read the terms at: # http://www.apache.org/licenses/LICENSE-2.0 # To see the help and options, in comma... | 2.264035 | 2 |
src/core/mongo_manager.py | MihailButnaru/MongoIngestorS3 | 3 | 6627989 | # Copyright | 2019 | All rights reserved
# <NAME>
"""
Mongo manager will handle all the operations related to the mongo database
"""
class MongoManager():
"""
Mongo Manager handles the collections and documents from a collection
in a storage.
"""
def __init__(self, connection):
self._connec... | # Copyright | 2019 | All rights reserved
# <NAME>
"""
Mongo manager will handle all the operations related to the mongo database
"""
class MongoManager():
"""
Mongo Manager handles the collections and documents from a collection
in a storage.
"""
def __init__(self, connection):
self._connec... | en | 0.876934 | # Copyright | 2019 | All rights reserved # <NAME> Mongo manager will handle all the operations related to the mongo database Mongo Manager handles the collections and documents from a collection in a storage. Data is collected and stored in a list from mongo database, each collection is stored in a list ... | 3.371569 | 3 |
VowelConsonent.py | ethanwalsh98/ComputationalThinking | 0 | 6627990 | <filename>VowelConsonent.py<gh_stars>0
userInput = input("Enter your sentence: ")
vowels="AEIOUaeiou"
displayVowels=""
displayConsonants=""
for letter in userImput:
if letter in vowels:
displayVowels += letter
else:
displayConsonants = displayConsonants + letter
print("Vowels: " + displayVow... | <filename>VowelConsonent.py<gh_stars>0
userInput = input("Enter your sentence: ")
vowels="AEIOUaeiou"
displayVowels=""
displayConsonants=""
for letter in userImput:
if letter in vowels:
displayVowels += letter
else:
displayConsonants = displayConsonants + letter
print("Vowels: " + displayVow... | none | 1 | 3.905045 | 4 | |
dbms/tests/integration/test_storage_s3/test.py | sunadm/ClickHouse | 3 | 6627991 | <gh_stars>1-10
import json
import logging
import random
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance
import helpers.client
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
# Creates S3 bucket for tests and allows anonymous read-... | import json
import logging
import random
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance
import helpers.client
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
# Creates S3 bucket for tests and allows anonymous read-write access to... | en | 0.76105 | # Creates S3 bucket for tests and allows anonymous read-write access to it. # Allows read-write access for bucket without authorization. # Returns content of given S3 file as string. # type: (ClickHouseCluster, str) -> str # Returns nginx access log lines. # type: (ClickHouseInstance, str, object, dict) -> str # Test s... | 1.80993 | 2 |
faceswap/lib/image.py | huangjunxiong11/FaceMap | 2 | 6627992 | <reponame>huangjunxiong11/FaceMap<filename>faceswap/lib/image.py<gh_stars>1-10
#!/usr/bin python3
""" Utilities for working with images and videos """
import logging
import re
import subprocess
import os
import sys
from bisect import bisect
from concurrent import futures
from hashlib import sha1
import cv2
import im... | #!/usr/bin python3
""" Utilities for working with images and videos """
import logging
import re
import subprocess
import os
import sys
from bisect import bisect
from concurrent import futures
from hashlib import sha1
import cv2
import imageio
import imageio_ffmpeg as im_ffm
import numpy as np
from tqdm import tqdm
... | en | 0.796578 | #!/usr/bin python3 Utilities for working with images and videos # pylint:disable=invalid-name # ################### # # <<< IMAGE UTILS >>> # # ################### # # <<< IMAGE IO >>> # Monkey patch imageio ffmpeg to use keyframes whilst seeking Store the source video's keyframes in :attr:`_frame_info" for the current... | 2.411046 | 2 |
src/AsmvarVarScore/modul/VariantRecalibratorArgumentCollection.py | bioinformatics-centre/AsmVar | 17 | 6627993 | <reponame>bioinformatics-centre/AsmVar<filename>src/AsmvarVarScore/modul/VariantRecalibratorArgumentCollection.py<gh_stars>10-100
"""
====================================
====================================
Author : <NAME>
Date : 2014-05-21 18:03:28
"""
class VariantRecalibratorArgumentCollection:
def __init__... | """
====================================
====================================
Author : <NAME>
Date : 2014-05-21 18:03:28
"""
class VariantRecalibratorArgumentCollection:
def __init__ (self):
self.NITER = 150
self.NINIT = 100
self.STD_THRESHOLD = 10.0
self.MIN_NUM_BAD_VARI... | en | 0.702854 | ==================================== ==================================== Author : <NAME> Date : 2014-05-21 18:03:28 # The ratio of Traing date set # The ratio of cross validation data set # The ratio of test data set # The threshold that the positive training set -> negative | 2.546165 | 3 |
epgsearch/src/EPGSearchSetup.py | FoxyRabbit67/enigma2-plugins | 41 | 6627994 | <reponame>FoxyRabbit67/enigma2-plugins
# for localized messages
# GUI (Screens)
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import ConfigSelection, NoSave
# GUI (Summary)
from Screens.Setup import SetupSummary
from Screens.InfoBar import InfoBar
# GUI (... | # for localized messages
# GUI (Screens)
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import ConfigSelection, NoSave
# GUI (Summary)
from Screens.Setup import SetupSummary
from Screens.InfoBar import InfoBar
# GUI (Components)
from Components.ActionMap i... | en | 0.285984 | # for localized messages # GUI (Screens) # GUI (Summary) # GUI (Components) # Configuration <screen name="EPGSearchSetup" position="center,90" size="820,570"> <ePixmap pixmap="skin_default/buttons/red.png" position="10,5" size="200,40"/> <ePixmap pixmap="skin_default/buttons/green.png" position="210,5" size="200,40... | 2.085022 | 2 |
src/batou/secrets/encryption.py | wosc/batou | 1 | 6627995 | <reponame>wosc/batou
from batou import FileLockedError
from configupdater import ConfigUpdater
import fcntl
import glob
import io
import os
import shlex
import subprocess
import tempfile
# https://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/
NULL = tempfile.TemporaryFile()
NEW_FILE... | from batou import FileLockedError
from configupdater import ConfigUpdater
import fcntl
import glob
import io
import os
import shlex
import subprocess
import tempfile
# https://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/
NULL = tempfile.TemporaryFile()
NEW_FILE_TEMPLATE = """\
[bat... | en | 0.869548 | # https://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/ \ [batou] members = Basic encryption methods - key management handled externally. Context manager that opens an encrypted file. Use the read() and write() methods in the subordinate "with" block to manipulate cle... | 2.618455 | 3 |
tests/app/billing/test_billing.py | cds-snc/notifier-api | 41 | 6627996 | <reponame>cds-snc/notifier-api
import json
from calendar import monthrange
from datetime import datetime, timedelta
import pytest
from freezegun import freeze_time
from app.billing.rest import update_free_sms_fragment_limit_data
from app.dao.annual_billing_dao import dao_get_free_sms_fragment_limit_for_year
from app.... | import json
from calendar import monthrange
from datetime import datetime, timedelta
import pytest
from freezegun import freeze_time
from app.billing.rest import update_free_sms_fragment_limit_data
from app.dao.annual_billing_dao import dao_get_free_sms_fragment_limit_for_year
from app.dao.date_util import (
get_... | none | 1 | 2.058361 | 2 | |
problems/ploppers2/executable.py | ShadowWei/Ytopt_fall19 | 0 | 6627997 | #!/usr/bin/env python
from __future__ import print_function
import re
import os
import sys
import time
import json
import math
import os
import argparse
import numpy as np
sys.path.insert(0, '/uufs/chpc.utah.edu/common/home/u1074259/ytopt/plopper')
from plopper import Plopper
from numpy import abs, cos, exp, mean, pi... | #!/usr/bin/env python
from __future__ import print_function
import re
import os
import sys
import time
import json
import math
import os
import argparse
import numpy as np
sys.path.insert(0, '/uufs/chpc.utah.edu/common/home/u1074259/ytopt/plopper')
from plopper import Plopper
from numpy import abs, cos, exp, mean, pi... | en | 0.283882 | #!/usr/bin/env python #p0_dict #p1_dict #p2_dict #PF_dict #SI_dict #SC_dict #NT_dict #CO_dict #TL_dict #static or dynamic #1, 8, 16 Chunk Size? #1, 2, 4, 8, 14, 16, 28 NT? #1, 2, 3 Collapse #32, 64, 128, 256 thread limit? #p3", 'c': "#pragma omp target teams distribute #p #p"} #p0 #p3", 'c': "#pragma omp target t... | 2.351671 | 2 |
swift_undelete/tests/test_middleware.py | alexalv/swift_undelete | 0 | 6627998 | <filename>swift_undelete/tests/test_middleware.py
#!/usr/bin/env python
# Copyright (c) 2014 SwiftStack, 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/lice... | <filename>swift_undelete/tests/test_middleware.py
#!/usr/bin/env python
# Copyright (c) 2014 SwiftStack, 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/lice... | en | 0.897774 | #!/usr/bin/env python # Copyright (c) 2014 SwiftStack, 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... | 2.298631 | 2 |
tests/test_iou_box3d.py | janEbert/pytorch3d | 0 | 6627999 | <gh_stars>0
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import pickle
import random
import unittest
from typing import List, Tuple, Union
import torch
imp... | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import pickle
import random
import unittest
from typing import List, Tuple, Union
import torch
import torch.nn... | en | 0.837267 | # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. Wrapper around box3d_overlap_naive to support batched input Wrapper around box3d_overlap_sampling to sup... | 1.717056 | 2 |
tests/tuples.py | fuzziqersoftware/nemesys | 9 | 6628000 | # a is iterable because its values are all the same type
a = (1, 2, 3, 4)
for x in a:
print(repr(x))
else:
print('done')
print('a[-4] is ' + repr(a[-4]))
print('a[-3] is ' + repr(a[-3]))
print('a[-2] is ' + repr(a[-2]))
print('a[-1] is ' + repr(a[-1]))
print('a[0] is ' + repr(a[0]))
print('a[1] is ' + repr(a[1]))
p... | # a is iterable because its values are all the same type
a = (1, 2, 3, 4)
for x in a:
print(repr(x))
else:
print('done')
print('a[-4] is ' + repr(a[-4]))
print('a[-3] is ' + repr(a[-3]))
print('a[-2] is ' + repr(a[-2]))
print('a[-1] is ' + repr(a[-1]))
print('a[0] is ' + repr(a[0]))
print('a[1] is ' + repr(a[1]))
p... | en | 0.948616 | # a is iterable because its values are all the same type # b is also iterable # c is not iterable because it contains disparate types | 4.171841 | 4 |
ckpt2np.py | ngocminhbui/resnet | 0 | 6628001 | import tensorflow as tf
import numpy as np
import argparse, os
if __name__ == '__main__':
print 'Example python ckpt2np.py model.ckpt-100.meta model.ckpt-100'
parser = argparse.ArgumentParser()
parser.add_argument('meta', help='meta file, (e.g. model.ckpt-100.meta)')
parser.add_argument('ckpt', help=... | import tensorflow as tf
import numpy as np
import argparse, os
if __name__ == '__main__':
print 'Example python ckpt2np.py model.ckpt-100.meta model.ckpt-100'
parser = argparse.ArgumentParser()
parser.add_argument('meta', help='meta file, (e.g. model.ckpt-100.meta)')
parser.add_argument('ckpt', help=... | none | 1 | 2.473381 | 2 | |
src/orion/benchmark/task/profet/model_utils.py | satyaog/orion | 0 | 6628002 | """ Options and utilities for training the profet meta-model from Emukit. """
import json
import pickle
import typing
import warnings
from abc import ABC
from copy import deepcopy
from dataclasses import dataclass
from logging import getLogger as get_logger
from pathlib import Path
from typing import Any, Callable, Cla... | """ Options and utilities for training the profet meta-model from Emukit. """
import json
import pickle
import typing
import warnings
from abc import ABC
from copy import deepcopy
from dataclasses import dataclass
from logging import getLogger as get_logger
from pathlib import Path
from typing import Any, Callable, Cla... | en | 0.738458 | Options and utilities for training the profet meta-model from Emukit. # type: ignore # NOTE: Need to set some garbage dummy values, so that the documentation can be generated without # actually having these values. Configuration options for the training of the Profet meta-model. Name of the benchmark. # ---------- "Abs... | 2.535363 | 3 |
python/python/repeated_word/test_repeated.py | iggy18/data-structures-and-algorithms | 0 | 6628003 | <filename>python/python/repeated_word/test_repeated.py<gh_stars>0
from repeated_word import strip_down, not_split, seen_word, which_word_is_repeated_first, repeated_word_dict
def test_strip_down():
assert strip_down
def test_not_split():
assert not_split
def test_seen_word():
assert seen_word
def test_... | <filename>python/python/repeated_word/test_repeated.py<gh_stars>0
from repeated_word import strip_down, not_split, seen_word, which_word_is_repeated_first, repeated_word_dict
def test_strip_down():
assert strip_down
def test_not_split():
assert not_split
def test_seen_word():
assert seen_word
def test_... | en | 0.823822 | #function using built in methods and dictionary | 3.611131 | 4 |
sc2_imitation_learning/agents/__init__.py | metataro/sc2_imitation_learning | 15 | 6628004 | <reponame>metataro/sc2_imitation_learning
import collections
from abc import ABC, abstractmethod
from typing import Tuple, Optional, Text
import sonnet as snt
import tensorflow as tf
import tree
from sonnet.src import types
from sc2_imitation_learning.environment.environment import ActionSpace, ObservationSpace
Agen... | import collections
from abc import ABC, abstractmethod
from typing import Tuple, Optional, Text
import sonnet as snt
import tensorflow as tf
import tree
from sonnet.src import types
from sc2_imitation_learning.environment.environment import ActionSpace, ObservationSpace
AgentOutput = collections.namedtuple('AgentOut... | en | 0.636542 | # Add time dimension. # Remove time dimension. | 2.441078 | 2 |
lib/JumpScale/lib/ssh/disklayout/mount.py | rudecs/jumpscale_core7 | 0 | 6628005 | <reponame>rudecs/jumpscale_core7
from JumpScale import j
from fabric.api import settings
class MountError(Exception):
pass
class Mount(object):
def __init__(self, con, device, path=None, options=''):
self._con = con
self._device = device
self._path = path
self._autoClean = Fa... | from JumpScale import j
from fabric.api import settings
class MountError(Exception):
pass
class Mount(object):
def __init__(self, con, device, path=None, options=''):
self._con = con
self._device = device
self._path = path
self._autoClean = False
if self._path is None... | en | 0.75692 | Mount partition Umount partition | 2.292828 | 2 |
github_test.py | mitodl/release-script | 15 | 6628006 | <reponame>mitodl/release-script<filename>github_test.py
"""Tests for github functions"""
import json
import os
from urllib.parse import quote
import pytest
from constants import SCRIPT_DIR
from github import (
add_label,
create_pr,
delete_label,
get_labels,
get_org_and_repo,
get_pull_request,
... | """Tests for github functions"""
import json
import os
from urllib.parse import quote
import pytest
from constants import SCRIPT_DIR
from github import (
add_label,
create_pr,
delete_label,
get_labels,
get_org_and_repo,
get_pull_request,
github_auth_headers,
needs_review,
NEEDS_REV... | en | 0.746566 | Tests for github functions Assert behavior of needs review create_pr should create a pr or raise an exception if the attempt failed github_auth_headers should have appropriate headers for autentication get_org_and_repo should get the GitHub organization and repo from the directory get_labels should retrieve labels from... | 2.29133 | 2 |
pagesext/tests/__init__.py | dlancer/django-pages-cms-extensions | 1 | 6628007 | <filename>pagesext/tests/__init__.py
from pagesext.tests.test_pages import *
__test__ = {'pagesext.tests.TestPages': ['test_pages']}
| <filename>pagesext/tests/__init__.py
from pagesext.tests.test_pages import *
__test__ = {'pagesext.tests.TestPages': ['test_pages']}
| none | 1 | 1.394802 | 1 | |
animation_experimentation.py | tobyrcod/PiPet | 1 | 6628008 | from sense_hat import SenseHat
from time import sleep
import random
s = SenseHat()
default = True
p = (190, 174, 243)
b = (0,0,0)
w = (255, 255, 255)
yellow = (255, 255, 0)
blue = (0, 0, 255)
#prow = [p, p, p, p, p, p, p, p] #this does not work, when replace this with a whole row
#a pixel list must have 64 elements... | from sense_hat import SenseHat
from time import sleep
import random
s = SenseHat()
default = True
p = (190, 174, 243)
b = (0,0,0)
w = (255, 255, 255)
yellow = (255, 255, 0)
blue = (0, 0, 255)
#prow = [p, p, p, p, p, p, p, p] #this does not work, when replace this with a whole row
#a pixel list must have 64 elements... | en | 0.796885 | #prow = [p, p, p, p, p, p, p, p] #this does not work, when replace this with a whole row #a pixel list must have 64 elements in it #when creating designs, helps to draw it out by hand #s.clear(w) #may work in actual environment, as its a browser, may not import all things #rand_face.append(rand) #s.show_message("Hello"... | 2.580833 | 3 |
arduino/portable/sketchbook/libraries/Adafruit_MQTT_Library/examples/mqtt_arbitrary_data/python_subscriber/subscriber.py | devshop2019/mixlyTest | 542 | 6628009 | <filename>arduino/portable/sketchbook/libraries/Adafruit_MQTT_Library/examples/mqtt_arbitrary_data/python_subscriber/subscriber.py
'''MQTT subscriber for Adafruit MQTT library mqtt_arbitrary_buffer example'''
import paho.mqtt.client as mqtt
import argparse
import struct
import array
import sys
return_str =[
"Conne... | <filename>arduino/portable/sketchbook/libraries/Adafruit_MQTT_Library/examples/mqtt_arbitrary_data/python_subscriber/subscriber.py
'''MQTT subscriber for Adafruit MQTT library mqtt_arbitrary_buffer example'''
import paho.mqtt.client as mqtt
import argparse
import struct
import array
import sys
return_str =[
"Conne... | en | 0.748585 | MQTT subscriber for Adafruit MQTT library mqtt_arbitrary_buffer example # The callback for when the client receives a CONNACK response from the server. callback function on connect. Subscribes or exits depending on outcome # Subscribing in on_connect() means that if we lose the connection and # reconnect then subscript... | 2.860579 | 3 |
twig/compiler.py | vaporydev/twig | 16 | 6628010 | from pathlib import Path
from typing import Any, Dict
from ethpm.tools import builder as b
from ethpm.typing import Manifest
from twig.backends import VyperBackend
from twig.exceptions import CompilerError
from twig.utils.compiler import generate_contract_types, generate_inline_sources
class Compiler:
# todo sol... | from pathlib import Path
from typing import Any, Dict
from ethpm.tools import builder as b
from ethpm.typing import Manifest
from twig.backends import VyperBackend
from twig.exceptions import CompilerError
from twig.utils.compiler import generate_contract_types, generate_inline_sources
class Compiler:
# todo sol... | en | 0.539183 | # todo solidity backend - start from solc output &/or source contracts | 2.060652 | 2 |
kernel_two_sample_test.py | FabianHinder/drifting-data-in-continuous-time | 2 | 6628011 | <gh_stars>1-10
from __future__ import division
import numpy as np
from sys import stdout
from sklearn.metrics import pairwise_kernels
def MMD2u(K, m, n):
"""The MMD^2_u unbiased statistic.
"""
Kx = K[:m, :m]
Ky = K[m:, m:]
Kxy = K[:m, m:]
return 1.0 / (m * (m - 1.0)) * (Kx.sum() - Kx.diagonal(... | from __future__ import division
import numpy as np
from sys import stdout
from sklearn.metrics import pairwise_kernels
def MMD2u(K, m, n):
"""The MMD^2_u unbiased statistic.
"""
Kx = K[:m, :m]
Ky = K[m:, m:]
Kxy = K[:m, m:]
return 1.0 / (m * (m - 1.0)) * (Kx.sum() - Kx.diagonal().sum()) + \
... | en | 0.626115 | The MMD^2_u unbiased statistic. Compute the bootstrap null-distribution of MMD2u. Compute the bootstrap null-distribution of MMD2u given predefined permutations. Note:: verbosity is removed to improve speed. Compute MMD^2_u, its null distribution and the p-value of the kernel two-sample test. Note tha... | 2.758898 | 3 |
myapi/commons/errors/__init__.py | zobayer1/flask-tutorial | 4 | 6628012 | # -*- coding: utf-8 -*-
from enum import Enum
__all__ = ["Errors"]
class Errors(tuple, Enum):
"""Enums for error subtypes"""
SERVER_ERROR = (500001, "Something Went Wrong")
| # -*- coding: utf-8 -*-
from enum import Enum
__all__ = ["Errors"]
class Errors(tuple, Enum):
"""Enums for error subtypes"""
SERVER_ERROR = (500001, "Something Went Wrong")
| en | 0.591351 | # -*- coding: utf-8 -*- Enums for error subtypes | 2.81645 | 3 |
test/unit/common.py | isabella232/addonfactory-cloudconnect-library | 0 | 6628013 | <reponame>isabella232/addonfactory-cloudconnect-library
#
# Copyright 2021 Splunk 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
#
# Unles... | #
# Copyright 2021 Splunk 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 writing, so... | en | 0.850714 | # # Copyright 2021 Splunk 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 writing, so... | 1.423485 | 1 |
app/database/add_primadonna.py | KindtAnton/Haldis | 0 | 6628014 | <filename>app/database/add_primadonna.py<gh_stars>0
"Script to add Primadonna to Haldis"
from app import db
from models import Location, Product
def add():
"Add Primadonna to the database"
addTA()
addAfhalen()
pizzasTA = {
"Peperoni": 750,
"Basis pizza (extra garneringen zie site)": 600,
"Pa... | <filename>app/database/add_primadonna.py<gh_stars>0
"Script to add Primadonna to Haldis"
from app import db
from models import Location, Product
def add():
"Add Primadonna to the database"
addTA()
addAfhalen()
pizzasTA = {
"Peperoni": 750,
"Basis pizza (extra garneringen zie site)": 600,
"Pa... | none | 1 | 2.478406 | 2 | |
Priority Queue/PriorityQueue-1-Worse.py | jweisz/iui22-code-translation | 0 | 6628015 | <gh_stars>0
class priority_queue:
"""
Python code to implement a priority - queue using an
ArrayList - based implementation of a binary heap
This class can be parameterized for any element class that supports the Comparable
interface on itself
A priority queue a... | class priority_queue:
"""
Python code to implement a priority - queue using an
ArrayList - based implementation of a binary heap
This class can be parameterized for any element class that supports the Comparable
interface on itself
A priority queue allows one ... | en | 0.829207 | Python code to implement a priority - queue using an ArrayList - based implementation of a binary heap This class can be parameterized for any element class that supports the Comparable interface on itself A priority queue allows one to store comparable elements ... | 4.247565 | 4 |
onnx_tf/common/handler_helper.py | pluradj/onnx-tensorflow | 0 | 6628016 | <filename>onnx_tf/common/handler_helper.py<gh_stars>0
from onnx import defs
from onnx_tf.handlers.backend import * # noqa
from onnx_tf.handlers.backend_handler import BackendHandler
import onnx_tf.common as common
def get_all_backend_handlers(opset_dict):
""" Get a dict of all backend handler classes.
e.g. {'dom... | <filename>onnx_tf/common/handler_helper.py<gh_stars>0
from onnx import defs
from onnx_tf.handlers.backend import * # noqa
from onnx_tf.handlers.backend_handler import BackendHandler
import onnx_tf.common as common
def get_all_backend_handlers(opset_dict):
""" Get a dict of all backend handler classes.
e.g. {'dom... | en | 0.349576 | # noqa Get a dict of all backend handler classes. e.g. {'domain': {'Abs': Abs handler class}, ...}, }. :param opset_dict: A dict of opset. e.g. {'domain': version, ...} :return: Dict. Get backend coverage for document. :return: onnx_coverage: e.g. {'domain': {'ONNX_OP': [versions], ...}, ...} | 2.11494 | 2 |
pyforce/env/base.py | olemeyer/pyforce | 4 | 6628017 | import gym
import numpy as np
#Base class for all environment wrappers.
#Implements forwarding of all essential methods of the OpenAI Gyms (reset,step and render).
#Furthermore the original environment is kept and can be accessed from the wrapper.
class EnvWrapper(gym.Env):
def __init__(self,env):
self.env=env... | import gym
import numpy as np
#Base class for all environment wrappers.
#Implements forwarding of all essential methods of the OpenAI Gyms (reset,step and render).
#Furthermore the original environment is kept and can be accessed from the wrapper.
class EnvWrapper(gym.Env):
def __init__(self,env):
self.env=env... | en | 0.849707 | #Base class for all environment wrappers. #Implements forwarding of all essential methods of the OpenAI Gyms (reset,step and render). #Furthermore the original environment is kept and can be accessed from the wrapper. | 2.622342 | 3 |
skyportal/handlers/api/internal/source_views.py | Hallflower20/skyportal | 0 | 6628018 | <reponame>Hallflower20/skyportal<gh_stars>0
import datetime
from sqlalchemy import func, desc
from sqlalchemy.orm import joinedload
import tornado.web
from baselayer.app.access import auth_or_token
from ...base import BaseHandler
from ....models import DBSession, Obj, Source, SourceView
from .recent_sources import firs... | import datetime
from sqlalchemy import func, desc
from sqlalchemy.orm import joinedload
import tornado.web
from baselayer.app.access import auth_or_token
from ...base import BaseHandler
from ....models import DBSession, Obj, Source, SourceView
from .recent_sources import first_thumbnail_public_url
default_prefs = {'m... | en | 0.866966 | # Returns Source.obj # Ensure user has access to source # This endpoint will only be hit by front-end, so this will never be a token | 1.933365 | 2 |
ahc_tools/test/test_match.py | rdo-management/ahc-tools | 0 | 6628019 | <reponame>rdo-management/ahc-tools<filename>ahc_tools/test/test_match.py
# 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... | # 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.860294 | # 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.658686 | 2 |
tests/test_downloadermiddleware_robotstxt.py | wahello/scrapy | 3 | 6628020 | from unittest import mock
from twisted.internet import reactor, error
from twisted.internet.defer import Deferred, DeferredList, maybeDeferred
from twisted.python import failure
from twisted.trial import unittest
from scrapy.downloadermiddlewares.robotstxt import (RobotsTxtMiddleware,
... | from unittest import mock
from twisted.internet import reactor, error
from twisted.internet.defer import Deferred, DeferredList, maybeDeferred
from twisted.python import failure
from twisted.trial import unittest
from scrapy.downloadermiddlewares.robotstxt import (RobotsTxtMiddleware,
... | en | 0.434343 | User-Agent: * Disallow: /admin/ Disallow: /static/ # taken from https://en.wikipedia.org/robots.txt Disallow: /wiki/K%C3%A4ytt%C3%A4j%C3%A4: Disallow: /wiki/Käyttäjä: User-Agent: UnicödeBöt Disallow: /some/randome/page.html # garbage response should be discarded, equal 'allow all' # empty response should equal 'allow a... | 2.303633 | 2 |
setup.py | dvdotsenko/jsonrpc.py | 4 | 6628021 | from setuptools import setup, find_packages
version = '0.4.1'
long_description = """
JSON-RPC Parts is a library of composable components one would need to assemble a JSON-RPC server or client.
The parts provided are JSON-RPC message parser and serializer, a generic request handler collection, a WSGI-specific reques... | from setuptools import setup, find_packages
version = '0.4.1'
long_description = """
JSON-RPC Parts is a library of composable components one would need to assemble a JSON-RPC server or client.
The parts provided are JSON-RPC message parser and serializer, a generic request handler collection, a WSGI-specific reques... | en | 0.820115 | JSON-RPC Parts is a library of composable components one would need to assemble a JSON-RPC server or client. The parts provided are JSON-RPC message parser and serializer, a generic request handler collection, a WSGI-specific request handler and bits and pieces. This JSON-RPC Parts collection supports both, JSON-RPC ... | 1.557745 | 2 |
jechova.py | pyvec/jechova | 3 | 6628022 | <gh_stars>1-10
from argparse import ArgumentParser
import os
import sys
from operator import attrgetter
import arrow
from ics import Calendar
import requests
from slack import WebClient
# Only send a message when the number of remaining days is a key here.
# Values are emoji names; they should be more urgent for sma... | from argparse import ArgumentParser
import os
import sys
from operator import attrgetter
import arrow
from ics import Calendar
import requests
from slack import WebClient
# Only send a message when the number of remaining days is a key here.
# Values are emoji names; they should be more urgent for smaller numbers.
N... | en | 0.755785 | # Only send a message when the number of remaining days is a key here. # Values are emoji names; they should be more urgent for smaller numbers. # nb. `emoji` keeps the value from the last iteration of this loop #informace-na-pyvo-cz" #C97Q9HHHT>)', # links to #pyvo channel | 2.455244 | 2 |
d2scream/__init__.py | minervaclient/2scream | 2 | 6628023 | <filename>d2scream/__init__.py
from __future__ import absolute_import
from __future__ import unicode_literals
from . import login_shibboleth
from . import course_ids
from . import grades as grades_mod
from . import assign as assign_mod
class CourseActions():
def __init__(self,creds,ou):
self.creds = creds... | <filename>d2scream/__init__.py
from __future__ import absolute_import
from __future__ import unicode_literals
from . import login_shibboleth
from . import course_ids
from . import grades as grades_mod
from . import assign as assign_mod
class CourseActions():
def __init__(self,creds,ou):
self.creds = creds... | none | 1 | 2.337674 | 2 | |
airflow/plugins/operators/load_dimension.py | zqf1616/Udacity_project | 0 | 6628024 | from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class LoadDimensionOperator(BaseOperator):
ui_color = '#80BD9E'
dimension_table_insert_sql = """
INSERT INTO {destination_table}
{insert_sql}
"""
#... | from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class LoadDimensionOperator(BaseOperator):
ui_color = '#80BD9E'
dimension_table_insert_sql = """
INSERT INTO {destination_table}
{insert_sql}
"""
#... | en | 0.448775 | INSERT INTO {destination_table} {insert_sql} # dimension_table_drop_sql = """ # DELETE FROM {destination_table} # """ # Define your operators params (with defaults) here # Example: # conn_id = your-connection-name # Map params here # Example: # self.conn_id = conn_id #self.log.info('LoadDimensionOperato... | 2.236456 | 2 |
shop/models.py | BranimirKoprivnjak/django-ecommerce | 0 | 6628025 | from django.db import models
from django.utils.text import slugify
from accounts.models import User
from django.shortcuts import reverse
from django.contrib.auth import get_user_model
from checkout.models import BillingAddress
User = get_user_model()
CATEGORY_CHOICES = [
#(item in db, human readable text)
('J... | from django.db import models
from django.utils.text import slugify
from accounts.models import User
from django.shortcuts import reverse
from django.contrib.auth import get_user_model
from checkout.models import BillingAddress
User = get_user_model()
CATEGORY_CHOICES = [
#(item in db, human readable text)
('J... | en | 0.732698 | #(item in db, human readable text) #if added after initial migrations, delete the initial migration log #req: Pillow #needed when clicking to see detail item page #will create cross reference table (join table) in db | 2.102943 | 2 |
space_manager/cabinets/serializers.py | yoojat/Space-Manager | 0 | 6628026 | from rest_framework import serializers
from space_manager.branches import serializers as branch_serializers
from space_manager.cabinets import serializers as cabinet_serializers
from . import models
from space_manager.branches import models as branch_models
from space_manager.users import serializers as user_serializer... | from rest_framework import serializers
from space_manager.branches import serializers as branch_serializers
from space_manager.cabinets import serializers as cabinet_serializers
from . import models
from space_manager.branches import models as branch_models
from space_manager.users import serializers as user_serializer... | en | 0.4759 | # cabinets = CabinetSerializerForSelect(many=True) | 1.991096 | 2 |
src/sima/simo/compensatortype.py | SINTEF/simapy | 0 | 6628027 | <filename>src/sima/simo/compensatortype.py
# Generated with CompensatorType
#
from enum import Enum
from enum import auto
class CompensatorType(Enum):
""""""
GENERIC = auto()
NOT_IMPLEMENTED = auto()
def label(self):
if self == CompensatorType.GENERIC:
return "Generic model"
... | <filename>src/sima/simo/compensatortype.py
# Generated with CompensatorType
#
from enum import Enum
from enum import auto
class CompensatorType(Enum):
""""""
GENERIC = auto()
NOT_IMPLEMENTED = auto()
def label(self):
if self == CompensatorType.GENERIC:
return "Generic model"
... | en | 0.889859 | # Generated with CompensatorType # | 2.649789 | 3 |
deepchem/molnet/load_function/kinase_datasets.py | cjgalvin/deepchem | 3 | 6628028 | """
KINASE dataset loader
"""
import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/KINASE_training_disguised_combined_full.csv.gz"
VALID_UR = "https://de... | """
KINASE dataset loader
"""
import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/KINASE_training_disguised_combined_full.csv.gz"
VALID_UR = "https://de... | en | 0.90836 | KINASE dataset loader Remove missing entries. Some of the datasets have missing entries that sneak in as zero'd out feature vectors. Get rid of them. Gets transformers applied to the dataset #TODO: Check for this # Download files if they don't exist # Featurize the KINASE dataset # Shuffle the training data # Appl... | 2.572999 | 3 |
pruebas/_soporte/arbol/fabric/python.py | dued/dued | 0 | 6628029 | "Artefactos de distribución de PyPI /etc."
from dued import artefacto, Coleccion
@artefacto(nombre="all", default=True)
def all_(c):
"Fabrica todos los paquetes de Python."
pass
@artefacto
def sdist(c):
"Construye tar.gz de estilo clásico."
pass
@artefacto
def wheel(c):
"Construye una distb. ... | "Artefactos de distribución de PyPI /etc."
from dued import artefacto, Coleccion
@artefacto(nombre="all", default=True)
def all_(c):
"Fabrica todos los paquetes de Python."
pass
@artefacto
def sdist(c):
"Construye tar.gz de estilo clásico."
pass
@artefacto
def wheel(c):
"Construye una distb. ... | none | 1 | 1.713826 | 2 | |
alipay/aop/api/domain/RefundPaidDetail.py | antopen/alipay-sdk-python-all | 213 | 6628030 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.TuitionRefundRoyaltyInfo import TuitionRefundRoyaltyInfo
class RefundPaidDetail(object):
def __init__(self):
self._plan_id = None
self._ref... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.TuitionRefundRoyaltyInfo import TuitionRefundRoyaltyInfo
class RefundPaidDetail(object):
def __init__(self):
self._plan_id = None
self._refund_amount = None
... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.212597 | 2 |
tensorflow_model_analysis/eval_saved_model/example_trainers/fixed_prediction_estimator_extra_fields.py | josephw-ml/model-analysis | 0 | 6628031 | # Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.743686 | # Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.194956 | 2 |
C2Server/app/setting.py | Master-cai/C2 | 2 | 6628032 | <filename>C2Server/app/setting.py
import os
BASE_DIR = os.path.dirname(os.path.dirname((os.path.abspath(__file__))))
TEMPLATE_FOLDER = os.path.join(BASE_DIR, 'templates')
class Config:
DEBUG = False
TESTING = False
SECRET_KEY = '<KEY>'
SQLALCHEMY_TRACK_MODIFICATIONS = False
def get_db_uri(dbconfig)... | <filename>C2Server/app/setting.py
import os
BASE_DIR = os.path.dirname(os.path.dirname((os.path.abspath(__file__))))
TEMPLATE_FOLDER = os.path.join(BASE_DIR, 'templates')
class Config:
DEBUG = False
TESTING = False
SECRET_KEY = '<KEY>'
SQLALCHEMY_TRACK_MODIFICATIONS = False
def get_db_uri(dbconfig)... | none | 1 | 2.290018 | 2 | |
tests/intensive/collections_tests.py | Bukkster/fiftyone | 3 | 6628033 | """
Sample collections tests.
All of these tests are designed to be run manually via::
pytest tests/intensive/collections_tests.py -s -k test_<name>
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import random
import unittest
import fiftyone as fo
import fiftyone.zoo as foz
f... | """
Sample collections tests.
All of these tests are designed to be run manually via::
pytest tests/intensive/collections_tests.py -s -k test_<name>
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import random
import unittest
import fiftyone as fo
import fiftyone.zoo as foz
f... | en | 0.618808 | Sample collections tests. All of these tests are designed to be run manually via:: pytest tests/intensive/collections_tests.py -s -k test_<name> | Copyright 2017-2022, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | # Test simple fields # Test array fields # Test simple fields # Test array fields | 2.771027 | 3 |
autogp/util/util.py | Alwaysproblem/AutoGP | 1 | 6628034 | <gh_stars>1-10
from __future__ import division
import copy
import tensorflow as tf
def tri_vec_shape(N):
return [N * (N + 1) // 2]
def init_list(init, dims):
def empty_list(dims):
if not dims:
return None
else:
return [copy.deepcopy(empty_list(dims[1:])) for i in ran... | from __future__ import division
import copy
import tensorflow as tf
def tri_vec_shape(N):
return [N * (N + 1) // 2]
def init_list(init, dims):
def empty_list(dims):
if not dims:
return None
else:
return [copy.deepcopy(empty_list(dims[1:])) for i in range(dims[0])]
... | none | 1 | 2.312126 | 2 | |
tests/test_github_search.py | drusk/osstrends | 0 | 6628035 | <gh_stars>0
# Copyright (C) 2013 <NAME>
#
# 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 without limitation the
# rights to use, copy, modify, merge, publish, ... | # Copyright (C) 2013 <NAME>
#
# 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 without limitation the
# rights to use, copy, modify, merge, publish, distribute, ... | en | 0.768919 | # Copyright (C) 2013 <NAME> # # 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 without limitation the # rights to use, copy, modify, merge, publish, distribute, ... | 1.905173 | 2 |
src/huntsman/pocs/archive/archiver.py | JAAlvarado-Montes/huntsman-pocs | 0 | 6628036 | """ Code to facilitate delayed archiving of FITS files in the images directory """
import os
import time
import queue
import atexit
import shutil
from contextlib import suppress
from threading import Thread
from astropy import units as u
from panoptes.utils import get_quantity_value
from panoptes.utils.time import cur... | """ Code to facilitate delayed archiving of FITS files in the images directory """
import os
import time
import queue
import atexit
import shutil
from contextlib import suppress
from threading import Thread
from astropy import units as u
from panoptes.utils import get_quantity_value
from panoptes.utils.time import cur... | en | 0.805384 | Code to facilitate delayed archiving of FITS files in the images directory Class to watch the images directory for new files and move them to the archive directory after enough time has passed. Args: images_directory (str): The images directory to archive. If None (default), uses the dir... | 2.806269 | 3 |
CAIL2020/jesb/datagen/contract_test.py | ShenDezhou/CAIL | 71 | 6628037 | <filename>CAIL2020/jesb/datagen/contract_test.py
import os
import random
import re
import pandas
dic=[]
with open('amount_v1v2.dic', 'r', encoding='utf-8') as f:
lines = f.readlines()
dic.extend([l.strip() for l in lines])
print(len(dic))
regdic = []
for word in dic:
if '_' in word:
word = word.r... | <filename>CAIL2020/jesb/datagen/contract_test.py
import os
import random
import re
import pandas
dic=[]
with open('amount_v1v2.dic', 'r', encoding='utf-8') as f:
lines = f.readlines()
dic.extend([l.strip() for l in lines])
print(len(dic))
regdic = []
for word in dic:
if '_' in word:
word = word.r... | en | 0.322569 | # for dirpath, dnames, fnames in os.walk("txt/"): # for file in fnames: # res = reg_trigger(line) # if res: # formald = gen_with_rule(type=random.randint(1,3)) # mathd = gen_with_rule(type=0) # # newline = res[1].sub(line, res[2] + formald + ("".join(random.sample(chinese_dic, random... | 2.359514 | 2 |
llvmpy/src/Bitcode/ReaderWriter.py | KennethNielsen/llvmpy | 140 | 6628038 | from binding import *
from ..namespace import llvm
from ..ADT.StringRef import StringRef
from ..Module import Module
from ..LLVMContext import LLVMContext
llvm.includes.add('llvm/Bitcode/ReaderWriter.h')
ParseBitCodeFile = llvm.CustomFunction('ParseBitCodeFile',
'llvm_ParseBitCo... | from binding import *
from ..namespace import llvm
from ..ADT.StringRef import StringRef
from ..Module import Module
from ..LLVMContext import LLVMContext
llvm.includes.add('llvm/Bitcode/ReaderWriter.h')
ParseBitCodeFile = llvm.CustomFunction('ParseBitCodeFile',
'llvm_ParseBitCo... | en | 0.330225 | # returns Module* # file-like object # return None # file-like object # return str # file-like object | 2.025917 | 2 |
tensorflow/lite/experimental/ruy/ruy_test_ext.bzl | PaulWang1905/tensorflow | 848 | 6628039 | <filename>tensorflow/lite/experimental/ruy/ruy_test_ext.bzl
"""
Allows to specialize the ruy BUILD to availability of external libraries
"""
def ruy_test_ext_defines():
return []
def ruy_test_ext_deps():
return []
| <filename>tensorflow/lite/experimental/ruy/ruy_test_ext.bzl
"""
Allows to specialize the ruy BUILD to availability of external libraries
"""
def ruy_test_ext_defines():
return []
def ruy_test_ext_deps():
return []
| en | 0.752198 | Allows to specialize the ruy BUILD to availability of external libraries | 1.218836 | 1 |
control/webapp/society.py | CHTJonas/control-panel | 0 | 6628040 | import re
from urllib.parse import urlparse
from werkzeug.exceptions import NotFound, Forbidden
from flask import Blueprint, render_template, request, redirect, url_for
from .utils import srcf_db_sess as sess
from .utils import parse_domain_name, create_job_maybe_email_and_redirect, find_mem_society
from . import ut... | import re
from urllib.parse import urlparse
from werkzeug.exceptions import NotFound, Forbidden
from flask import Blueprint, render_template, request, redirect, url_for
from .utils import srcf_db_sess as sess
from .utils import parse_domain_name, create_job_maybe_email_and_redirect, find_mem_society
from . import ut... | en | 0.983059 | # check that this isn't a shared mailbox | 2.292422 | 2 |
helm/dagster/schema/schema/charts/utils/kubernetes.py | kstennettlull/dagster | 0 | 6628041 | from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Extra # pylint: disable=no-name-in-module
from .utils import BaseModel as BaseModelWithNullableRequiredFields
from .utils import SupportedKubernetes, create_definition_ref
class Annotations(BaseModel):
__root__: ... | from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Extra # pylint: disable=no-name-in-module
from .utils import BaseModel as BaseModelWithNullableRequiredFields
from .utils import SupportedKubernetes, create_definition_ref
class Annotations(BaseModel):
__root__: ... | en | 0.264614 | # pylint: disable=no-name-in-module | 2.268896 | 2 |
setup.py | kennell/emojiflags | 2 | 6628042 | from setuptools import setup
setup(
name='flagz',
version='1.2.2',
py_modules=['flagz'],
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
url='https://github.com/kennell/flagz',
)
| from setuptools import setup
setup(
name='flagz',
version='1.2.2',
py_modules=['flagz'],
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
url='https://github.com/kennell/flagz',
)
| none | 1 | 1.074447 | 1 | |
robot/Car.py | toulouse-robot-race/turbot-simu | 5 | 6628043 | from robot.Config import STEERING_COEF
class Car:
def __init__(self, simulator, steering_handles, motors_handles, speed_controller, tachometer, gyro):
self.gyro = gyro
self.tachometer = tachometer
self.motors_handles = motors_handles
self.steering_handles = steering_handles
... | from robot.Config import STEERING_COEF
class Car:
def __init__(self, simulator, steering_handles, motors_handles, speed_controller, tachometer, gyro):
self.gyro = gyro
self.tachometer = tachometer
self.motors_handles = motors_handles
self.steering_handles = steering_handles
... | en | 0.671601 | # Apply exponential # TODO calibrate according to real robot | 2.729079 | 3 |
ACME/layer/Conv.py | mauriziokovacic/ACME | 3 | 6628044 | from .Layer import *
class Conv(Layer):
"""
A class representing a generic convolutional layer over 1D, 2D or 3D tensors
"""
def __init__(self, dim, *args, activation=None, batch_norm=None, pooling=None, **kwargs):
"""
Parameters
----------
dim : int
the di... | from .Layer import *
class Conv(Layer):
"""
A class representing a generic convolutional layer over 1D, 2D or 3D tensors
"""
def __init__(self, dim, *args, activation=None, batch_norm=None, pooling=None, **kwargs):
"""
Parameters
----------
dim : int
the di... | en | 0.345327 | A class representing a generic convolutional layer over 1D, 2D or 3D tensors Parameters ---------- dim : int the dimension of the convolution. Accepted dims are 1, 2 or 3 *args : ... the convolution layer arguments activation : torch.nn.Module (optional) ... | 3.391433 | 3 |
views_query_planning/query_planning.py | prio-data/views_query_planning | 0 | 6628045 | import logging
from typing import Dict
import enum
from itertools import chain
import networkx as nx
from networkx.exception import NetworkXNoPath
from networkx.algorithms.shortest_paths import shortest_path
import sqlalchemy as sa
from . import exceptions, definitions
logger = logging.getLogger(__name__)
def clas... | import logging
from typing import Dict
import enum
from itertools import chain
import networkx as nx
from networkx.exception import NetworkXNoPath
from networkx.algorithms.shortest_paths import shortest_path
import sqlalchemy as sa
from . import exceptions, definitions
logger = logging.getLogger(__name__)
def clas... | en | 0.809522 | Creates a directed graph of the FK->Referent relationships present in a list of tables. This graph can then be traversed to figure out how to perform a join when retrieving data from this collection of tables. compose_join Creates a list of operations that can be applied to a Query object, making it re... | 2.578346 | 3 |
script.module.placenta/lib/resources/lib/sources/en/filmxy.py | parser4life/tantrumrepo | 1 | 6628046 | <reponame>parser4life/tantrumrepo<filename>script.module.placenta/lib/resources/lib/sources/en/filmxy.py
# NEEDS FIXING
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICEN... | # NEEDS FIXING
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whate... | en | 0.462615 | # NEEDS FIXING # -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @tantrumdev wrote this file. As long as you retain this notice you # can do whatever y... | 1.998252 | 2 |
problem_3_parenting_partnering.py | ahmdshrif/codeJam2020 | 0 | 6628047 | <filename>problem_3_parenting_partnering.py
#read inputs
num_of_cases = int(input())
def is_time_overlab (calender , time2):
St2 = time2[0]
Et2 = time2[1]
for i in range(St2,Et2):
if i in calender :
return True
return False
def add_to_clender(calender , time2):
St2 = ti... | <filename>problem_3_parenting_partnering.py
#read inputs
num_of_cases = int(input())
def is_time_overlab (calender , time2):
St2 = time2[0]
Et2 = time2[1]
for i in range(St2,Et2):
if i in calender :
return True
return False
def add_to_clender(calender , time2):
St2 = ti... | en | 0.572532 | #read inputs # print(activities) # result = "IMPOSSIBLE" #{}: {}".format(case+1, "IMPOSSIBLE" ), flush = True) #{}: {}".format(case+1, "".join(result) ), flush = True) | 3.620106 | 4 |
ritsukosay.py | d3suu/ritsukosay | 0 | 6628048 | #!/usr/bin/python3
import sys
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# 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 without limitation the rights
# to ... | #!/usr/bin/python3
import sys
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# 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 without limitation the rights
# to ... | en | 0.573729 | #!/usr/bin/python3 # MIT License # # Copyright (c) 2021 <NAME> # # 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 without limitation the rights # to use, copy, m... | 1.699924 | 2 |
anaconda_project/internal/cli/download_commands.py | kathatherine/anaconda-project | 188 | 6628049 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# ... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------... | en | 0.731911 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, Anaconda, Inc. All rights reserved. # # Licensed under the terms of the BSD 3-Clause License. # The full license is in the file LICENSE.txt, distributed with this software. # -------------------... | 1.961016 | 2 |
geotext/__init__.py | bbo2adwuff/geotext | 102 | 6628050 | <reponame>bbo2adwuff/geotext
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.2.0'
from .geotext import GeoText | # -*- coding: utf-8 -*-
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.2.0'
from .geotext import GeoText | en | 0.769321 | # -*- coding: utf-8 -*- | 1.148511 | 1 |