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 |
|---|---|---|---|---|---|---|---|---|---|---|
dss/storage/bundles.py | DataBiosphere/data-store | 3 | 6630451 | import io
from functools import lru_cache
import json
import typing
import time
import re
from collections import OrderedDict
import cachetools
from cloud_blobstore import BlobNotFoundError, BlobStore
from dss import Config, Replica
from dss.api.search import PerPageBounds
from dss.storage.identifiers import (DSS_BUN... | import io
from functools import lru_cache
import json
import typing
import time
import re
from collections import OrderedDict
import cachetools
from cloud_blobstore import BlobNotFoundError, BlobStore
from dss import Config, Replica
from dss.api.search import PerPageBounds
from dss.storage.identifiers import (DSS_BUN... | en | 0.753998 | Return the contents of the bundle manifest file from cloud storage, subject to the rules of tombstoning. If version is None, return the latest version, once again, subject to the rules of tombstoning. If the bundle cannot be found, return None # need the ability to use fixture bucket for testing # handle the ... | 2.076172 | 2 |
tests/test_ezbee.py | ffreemt/ezbee | 0 | 6630452 | <gh_stars>0
"""Test ezbee."""
# pylint: disable=broad-except
from ezbee import __version__
from ezbee import ezbee
from ezbee.loadtext import loadtext
def test_version():
"""Test version."""
assert __version__[:3] == "0.1"
def test_sanity():
"""Sanity check."""
try:
assert not ezbee([""], [""... | """Test ezbee."""
# pylint: disable=broad-except
from ezbee import __version__
from ezbee import ezbee
from ezbee.loadtext import loadtext
def test_version():
"""Test version."""
assert __version__[:3] == "0.1"
def test_sanity():
"""Sanity check."""
try:
assert not ezbee([""], [""])
excep... | en | 0.302364 | Test ezbee. # pylint: disable=broad-except Test version. Sanity check. Test data/test-en/zh.txt. pytest tests\test_ezbee.py -k en_zh poetry remove holoviews plotly seaborn holoviews 1.14.8 plotly 5.6.0 seaborn 0.11.2 du -sh . # 452M poetry add -E holoviews plotly seaborn # (len(list1)... | 2.221175 | 2 |
inputs/trace_to_flow.py | flaviovdf/playlist-analysis | 0 | 6630453 | import pandas as pd
df = pd.read_csv('./transitions-mood-sound-gender-collaps.csv')
df = df[['playlist_id', 'source', 'tags', 'mood_source', 'mood_target',
'sound_source', 'sound_target', 'playlist_name', 'genre_source',
'genre_target']]
for i in range(len(df)):
row = df.ix[i]
try:
i... | import pandas as pd
df = pd.read_csv('./transitions-mood-sound-gender-collaps.csv')
df = df[['playlist_id', 'source', 'tags', 'mood_source', 'mood_target',
'sound_source', 'sound_target', 'playlist_name', 'genre_source',
'genre_target']]
for i in range(len(df)):
row = df.ix[i]
try:
i... | none | 1 | 2.920804 | 3 | |
station/__init__.py | mrbenjones/coffeetalk-python | 1 | 6630454 | <gh_stars>1-10
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
app = Flask(__name__)
app.config.from_object(Config)
#cors = CORS(app, resources={r"/get_calls/*": {"origins": "*"}})
cors = CORS(app)
db = SQLAlchemy(a... | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
app = Flask(__name__)
app.config.from_object(Config)
#cors = CORS(app, resources={r"/get_calls/*": {"origins": "*"}})
cors = CORS(app)
db = SQLAlchemy(app)
migrate = M... | en | 0.241252 | #cors = CORS(app, resources={r"/get_calls/*": {"origins": "*"}}) | 1.970525 | 2 |
HelpDesk/UpdateGEPrefix.py | flopezag/fiware-scrum-reports | 0 | 6630455 | <gh_stars>0
__author__ = '<NAME>'
import re
from jira.client import JIRA
from kernel.Settings import settings
server = settings.server['JIRA']
options = {'server': 'https://{}'.format(server.domain), 'verify': False}
# jira = JIRA(options, basic_auth=(server.username, server.password))
users = ('aalonsog', 'fermin',... | __author__ = '<NAME>'
import re
from jira.client import JIRA
from kernel.Settings import settings
server = settings.server['JIRA']
options = {'server': 'https://{}'.format(server.domain), 'verify': False}
# jira = JIRA(options, basic_auth=(server.username, server.password))
users = ('aalonsog', 'fermin', 'frb', 'aar... | en | 0.604633 | # jira = JIRA(options, basic_auth=(server.username, server.password)) # exit() # print('->right', n, issue.fields.summary) # print(n, issue, issue.fields.summary) # print(n, issue, issue.fields.issuetype, issue.fields.summary) | 2.271983 | 2 |
Errors/RequestFailedException.py | pjpmosteiro/DiscordGPT-3 | 49 | 6630456 | <filename>Errors/RequestFailedException.py
from string import Template
from Errors import *
from Errors.OpenAIError import OpenAIError
from Errors.TokenExhaustedError import TokenExhaustedError
from Errors.TokenInvalidError import TokenInvalidError
class RequestFailedException(Error):
def __init__(self, status_c... | <filename>Errors/RequestFailedException.py
from string import Template
from Errors import *
from Errors.OpenAIError import OpenAIError
from Errors.TokenExhaustedError import TokenExhaustedError
from Errors.TokenInvalidError import TokenInvalidError
class RequestFailedException(Error):
def __init__(self, status_c... | none | 1 | 2.786871 | 3 | |
qubekit/torsions/fitting/forcebalance_wrapper.py | qubekit/QUBEK | 45 | 6630457 | """
Classes that help with parameter fitting using ForceBalance.
"""
import abc
import copy
import os
import subprocess
from typing import Any, Dict, List, Tuple
from pydantic import BaseModel, Field, PositiveFloat, PositiveInt
from qcelemental.util import which_import
from typing_extensions import Literal
from qubek... | """
Classes that help with parameter fitting using ForceBalance.
"""
import abc
import copy
import os
import subprocess
from typing import Any, Dict, List, Tuple
from pydantic import BaseModel, Field, PositiveFloat, PositiveInt
from qcelemental.util import which_import
from typing_extensions import Literal
from qubek... | en | 0.817635 | Classes that help with parameter fitting using ForceBalance. A class which controls the forcebalance force field prior values. Returns: A formatted dict version of the prior that can be consumed by forcebalance. A base class which each forcebalnce target should overwrite. This should control the run tim... | 2.788165 | 3 |
modules/remoteprocessing/remotescript/pydas/__init__.py | jcfr/Midas | 20 | 6630458 | <reponame>jcfr/Midas
import json
import urllib
from communicator import Communicator
| import json
import urllib
from communicator import Communicator | none | 1 | 1.156469 | 1 | |
GeneralClassesFunctions/simulation_functions.py | EAOgroup/FEAST | 6 | 6630459 | """
All functions that are required in the simulations and independent of input data and detection method are stored here.
"""
import numpy as np
import random
import os
import pickle
def sample_wr(data, n_samples=1):
"""
Create a list of data by random sampling from a data set with replacement
... | """
All functions that are required in the simulations and independent of input data and detection method are stored here.
"""
import numpy as np
import random
import os
import pickle
def sample_wr(data, n_samples=1):
"""
Create a list of data by random sampling from a data set with replacement
... | en | 0.816776 | All functions that are required in the simulations and independent of input data and detection method are stored here. Create a list of data by random sampling from a data set with replacement
Inputs:
data List of data
n_samples number of samples to draw
Return:
sa... | 2.989686 | 3 |
test/test_mpc.py | JJusti/CrypTen | 0 | 6630460 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import math
import unittest
import crypten
import crypten.communicator as comm
impor... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import math
import unittest
import crypten
import crypten.communicator as comm
impor... | en | 0.819829 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. This class tests all functions of MPCTensor. # Check sizes match # Make sure these don't crash Tests MPCTensor.from_shar... | 2.069287 | 2 |
src/python/turicreate/__init__.py | rplom/turicreate | 1 | 6630461 | <filename>src/python/turicreate/__init__.py
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
'''
@package turicreate
...
Turi Create ... | <filename>src/python/turicreate/__init__.py
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
'''
@package turicreate
...
Turi Create ... | en | 0.76344 | # -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause @package turicreate ... Turi Create is a machine learning platform that enables data... | 1.724162 | 2 |
main/threadpool.py | haruhi5/Advance-python-example | 0 | 6630462 | import logging
import threading
from concurrent.futures import ThreadPoolExecutor
import time
import random
# Test function
def test(item):
s = random.randrange(1, 10)
logging.info(f'Thread {item}: id = {threading.get_ident()}')
logging.info(f'Thread {item}: name = {threading.current_thread()... | import logging
import threading
from concurrent.futures import ThreadPoolExecutor
import time
import random
# Test function
def test(item):
s = random.randrange(1, 10)
logging.info(f'Thread {item}: id = {threading.get_ident()}')
logging.info(f'Thread {item}: name = {threading.current_thread()... | en | 0.1013 | # Test function | 3.003041 | 3 |
astropy/io/fits/tests/test_fitsdiff.py | MatiasRepetto/astropy | 0 | 6630463 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import os
from . import FitsTestCase
from astropy.io.fits.convenience import writeto
from astropy.io.fits.hdu import PrimaryHDU, hdulist
from astropy.io.fits import Header, ImageHDU, HDUList, FITSDiff
from astropy.io.fits... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import os
from . import FitsTestCase
from astropy.io.fits.convenience import writeto
from astropy.io.fits.hdu import PrimaryHDU, hdulist
from astropy.io.fits import Header, ImageHDU, HDUList, FITSDiff
from astropy.io.fits... | en | 0.748929 | # Licensed under a 3-clause BSD style license - see LICENSE.rst fitsdiff: {version} a: {tmp_a} b: {tmp_b} Maximum number of different data values to be reported: 10 Relative tolerance: 0.01, Absolute tolerance: 0.0 Primary HDU: Data contains differences: Data differs at [1, 2]: a> 10.0 ? ... | 1.931735 | 2 |
weblogo-3.4_rd/test_corebio/test_nexus.py | go-bears/Final-Project | 0 | 6630464 | <reponame>go-bears/Final-Project
#!/usr/bin/env python
import unittest
from corebio.seq_io._nexus import Nexus
from test_corebio import *
class test_nexus(unittest.TestCase):
def test_create(self) :
n = Nexus()
self.assertNotEqual( n , None)
def test_parse_f0(self) :
f = ... | #!/usr/bin/env python
import unittest
from corebio.seq_io._nexus import Nexus
from test_corebio import *
class test_nexus(unittest.TestCase):
def test_create(self) :
n = Nexus()
self.assertNotEqual( n , None)
def test_parse_f0(self) :
f = testdata_stream("nexus/test_Nexus... | en | 0.288472 | #!/usr/bin/env python #self.output_basics(n) Test Tree module. # Return node_id of common ancestor if # taxon_list is monophyletic, -1 otherwise. | 2.513697 | 3 |
src/plugins/id.py | SaloxiddinTursunaliev/TelegramTaxiBot | 0 | 6630465 | <reponame>SaloxiddinTursunaliev/TelegramTaxiBot
@bot.message_handler(commands=['id', 'Id'])
def send_id(message):
cur.execute('SELECT * from language where id = %s', [str(message.from_user.id)])
record = cur.fetchall()
for row in record:
userid = row[0]
userlang = row[1]
username = message.from_user... | @bot.message_handler(commands=['id', 'Id'])
def send_id(message):
cur.execute('SELECT * from language where id = %s', [str(message.from_user.id)])
record = cur.fetchall()
for row in record:
userid = row[0]
userlang = row[1]
username = message.from_user.first_name.encode("utf-8")
userid = message.f... | none | 1 | 2.469614 | 2 | |
christmasCTF/2016/house_of_daehee (unsolved)/debug.py | PurpEth/solved-hacking-problem | 1 | 6630466 | import gdb
class AgainCommand(gdb.Command):
def __init__(self):
super(AgainCommand, self).__init__(
"again",
gdb.COMMAND_RUNNING
)
def invoke(self, arg, from_tty):
gdb.execute('tbreak *unlink+173') # b
gdb.execute('tbreak *main+807') # c
gdb.e... | import gdb
class AgainCommand(gdb.Command):
def __init__(self):
super(AgainCommand, self).__init__(
"again",
gdb.COMMAND_RUNNING
)
def invoke(self, arg, from_tty):
gdb.execute('tbreak *unlink+173') # b
gdb.execute('tbreak *main+807') # c
gdb.e... | en | 0.38951 | # b # c # b # a | 2.487408 | 2 |
src/developer/ffx/build/gn_generate_cmd.py | EnderNightLord-ChromeBook/zircon-rpi | 14 | 6630467 | <filename>src/developer/ffx/build/gn_generate_cmd.py
#!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import argparse
import os
import string
import sys
# Root dir is 5 levels up f... | <filename>src/developer/ffx/build/gn_generate_cmd.py
#!/usr/bin/env python3.8
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import argparse
import os
import string
import sys
# Root dir is 5 levels up f... | en | 0.902783 | #!/usr/bin/env python3.8 # Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Root dir is 5 levels up from here. | 2.186889 | 2 |
petl/test/io/test_sources.py | a-musing-moose/petl | 0 | 6630468 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import zipfile
from tempfile import NamedTemporaryFile
from petl.compat import PY2
from petl.test.helpers import ieq, eq_
import petl as etl
from petl.io.sources import StringSource, PopenSource, ZipSource, StdoutSource
def t... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import zipfile
from tempfile import NamedTemporaryFile
from petl.compat import PY2
from petl.test.helpers import ieq, eq_
import petl as etl
from petl.io.sources import StringSource, PopenSource, ZipSource, StdoutSource
def t... | en | 0.696918 | # -*- coding: utf-8 -*- # test writing to a string buffer # test reading from a string buffer # test appending # setup # test | 2.376603 | 2 |
Condor/Tools/Autorun/shell.py | OriolOriolOriol/Condor | 0 | 6630469 | <filename>Condor/Tools/Autorun/shell.py
# Import modules
import os.path
from os import remove
__startup_path = os.path.join(os.getenv("APPDATA"), "Microsoft\\Windows\\Start Menu\\Programs\\Startup")
""" Add to startup (startup dir) """
def Install(name, executable):
payload = (f"""
[InternetShortcut]
URL... | <filename>Condor/Tools/Autorun/shell.py
# Import modules
import os.path
from os import remove
__startup_path = os.path.join(os.getenv("APPDATA"), "Microsoft\\Windows\\Start Menu\\Programs\\Startup")
""" Add to startup (startup dir) """
def Install(name, executable):
payload = (f"""
[InternetShortcut]
URL... | en | 0.262843 | # Import modules Add to startup (startup dir) [InternetShortcut] URL=file://{os.path.abspath(executable)} Delete from startup (startup dir) Check if exists (startup dir) | 2.605238 | 3 |
tests/test_ulist.py | nclarey/pyg-base | 0 | 6630470 | from pyg_base import ulist, rng
def test_rng():
assert rng(3) == list(range(3))
def test_ulist():
assert ulist([1,3,2,1]) == list([1,3,2])
assert ulist([1,3,2,1]) + 4 == list([1,3,2,4])
assert ulist([1,3,2,1]) + [4,1] == list([1,3,2,4])
assert ulist([1,3,2,1]) + [4,1,5] == list([1,3,2,4,5])
a... | from pyg_base import ulist, rng
def test_rng():
assert rng(3) == list(range(3))
def test_ulist():
assert ulist([1,3,2,1]) == list([1,3,2])
assert ulist([1,3,2,1]) + 4 == list([1,3,2,4])
assert ulist([1,3,2,1]) + [4,1] == list([1,3,2,4])
assert ulist([1,3,2,1]) + [4,1,5] == list([1,3,2,4,5])
a... | none | 1 | 2.92488 | 3 | |
Athos/Networks/SqueezeNetCIFAR10/Squeezenet_model.py | shas19/EzPC | 1 | 6630471 | '''
Authors: <NAME>.
Copyright:
Copyright (c) 2018 Microsoft Research
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,... | '''
Authors: <NAME>.
Copyright:
Copyright (c) 2018 Microsoft Research
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.79513 | Authors: <NAME>.
Copyright:
Copyright (c) 2018 Microsoft Research
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, ... | 1.426519 | 1 |
cnn_models/help_fun.py | lijian10086/quantized_distillation | 321 | 6630472 | import torch
import torch.nn as nn
from torch.autograd import Variable
import math
import time
import numpy as np
import helpers.functions as mhf
import random
USE_CUDA = torch.cuda.is_available()
def time_forward_pass(model, train_loader):
model.eval()
start_time = time.time()
for idx_minibatch, data in... | import torch
import torch.nn as nn
from torch.autograd import Variable
import math
import time
import numpy as np
import helpers.functions as mhf
import random
USE_CUDA = torch.cuda.is_available()
def time_forward_pass(model, train_loader):
model.eval()
start_time = time.time()
for idx_minibatch, data in... | en | 0.85981 | # get the inputs # get the inputs #TODO: return_more_info is just there for backward compatibility. A big refactoring is due here, and there one should #remove the return_more_info flag # wrap them in Variable # forward + backward + optimize #if cutoff_entropy_value_distillation is not None, we use the distillation los... | 2.1504 | 2 |
src/Python/Visualization/NormalsDemo.py | cvandijck/VTKExamples | 309 | 6630473 | <filename>src/Python/Visualization/NormalsDemo.py
#!/usr/bin/env python
"""
"""
import vtk
def main():
colors = vtk.vtkNamedColors()
fileName = get_program_parameters()
polyData = ReadPolyData(fileName)
# A renderer.
renderer = vtk.vtkRenderer()
renderer.SetBackground(colors.GetColor3d("W... | <filename>src/Python/Visualization/NormalsDemo.py
#!/usr/bin/env python
"""
"""
import vtk
def main():
colors = vtk.vtkNamedColors()
fileName = get_program_parameters()
polyData = ReadPolyData(fileName)
# A renderer.
renderer = vtk.vtkRenderer()
renderer.SetBackground(colors.GetColor3d("W... | en | 0.808083 | #!/usr/bin/env python # A renderer. # Create background colors for each viewport. # Create a renderer for each view port. # Input # Normals (no split) # Normals (split) # Shared camera. # mapper # add the actor # Render window. # An interactor. # Start. (a) Faceted model without normals. (b) Polygons must be consis... | 2.566708 | 3 |
src/api/pdi/domain/operation/DataOperation.py | ahmetcagriakca/pythondataintegrator | 1 | 6630474 | <filename>src/api/pdi/domain/operation/DataOperation.py
from typing import List
from pdip.data import Entity
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from pdi.domain.base import Base
from pdi.domain.base.operation.DataOperationBase import DataOperationBase
fro... | <filename>src/api/pdi/domain/operation/DataOperation.py
from typing import List
from pdip.data import Entity
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from pdi.domain.base import Base
from pdi.domain.base.operation.DataOperationBase import DataOperationBase
fro... | none | 1 | 2.252126 | 2 | |
model/qalexnet.py | XueYue404/QNN | 0 | 6630475 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import seaborn as sns
import math
from torch.utils.data import DataLoader
from torch.autograd import Function
#从本项目中import
from m... | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import seaborn as sns
import math
from torch.utils.data import DataLoader
from torch.autograd import Function
#从本项目中import
from m... | zh | 0.729663 | #从本项目中import AlexNet分类器,用于CIFAR10 用法: network = AlexNet(isquant=True,bitA=4,bitW=8) # 卷积层1,3通道输入,96个卷积核,核大小7*7,步长2,填充2 # 经过该层图像大小变为32-7+2*2 / 2 +1,15*15 # 经3*3最大池化,2步长,图像变为15-3 / 2 + 1, 7*7 # 卷积层2,96输入通道,256个卷积核,核大小5*5,步长1,填充2 # 经过该层图像变为7-5+2*2 / 1 + 1,7*7 # 经3*3最大池化,2步长,图像变为7-3 / 2 + 1, 3*3 # 卷积层3,256输入通道,384个卷积核,... | 2.779815 | 3 |
scitbx/suffixtree/test/tst_single.py | rimmartin/cctbx_project | 0 | 6630476 | from __future__ import division
from scitbx import suffixtree
from scitbx.suffixtree import single
import unittest
class TestWord(unittest.TestCase):
def test_single_word(self):
word = single.word()
ld = word.length_descriptor()
self.assertEqual( len( word ), 0 )
self.assertEqual( ld(), 0 )
... | from __future__ import division
from scitbx import suffixtree
from scitbx.suffixtree import single
import unittest
class TestWord(unittest.TestCase):
def test_single_word(self):
word = single.word()
ld = word.length_descriptor()
self.assertEqual( len( word ), 0 )
self.assertEqual( ld(), 0 )
... | none | 1 | 2.883435 | 3 | |
tests/examples/test_integrations.py | fstroth/lightning-flash | 1 | 6630477 | # Copyright The PyTorch Lightning team.
#
# 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 i... | # Copyright The PyTorch Lightning team.
#
# 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 i... | en | 0.856613 | # Copyright The PyTorch Lightning team. # # 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 i... | 1.945434 | 2 |
fedml_api/standalone/hierarchical_fl/trainer.py | xuwanwei/FedML | 1,120 | 6630478 | import logging
import numpy as np
from fedml_api.standalone.hierarchical_fl.group import Group
from fedml_api.standalone.hierarchical_fl.client import Client
from fedml_api.standalone.fedavg.fedavg_trainer import FedAvgTrainer
class Trainer(FedAvgTrainer):
def setup_clients(self, train_data_local_num_dict, train... | import logging
import numpy as np
from fedml_api.standalone.hierarchical_fl.group import Group
from fedml_api.standalone.hierarchical_fl.client import Client
from fedml_api.standalone.fedavg.fedavg_trainer import FedAvgTrainer
class Trainer(FedAvgTrainer):
def setup_clients(self, train_data_local_num_dict, train... | en | 0.431468 | ###########setup_clients (START)#############") # maintain a dummy client to be used in FedAvgTrainer::local_test_on_all_clients() ###########setup_clients (END)#############") ###############Global Communication Round : {}".format(global_round_idx)) # train each group # aggregate group weights into the global weight #... | 2.156697 | 2 |
unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/column_specification.py | CharaD7/azure-sdk-for-python | 0 | 6630479 | <filename>unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/column_specification.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the proje... | <filename>unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/column_specification.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the proje... | en | 0.498983 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 2.023124 | 2 |
HER2/Practice Testing/Dropout Experiment/3_get_model_D7.py | raktim-mondol/DeepLearningCamelyon | 70 | 6630480 | def get_model():
model = Sequential()
model.add(Lambda(lambda x: x * 1./255., input_shape=(120, 160, 3), output_shape=(120, 160, 3)))
model.add(Conv2D(32, (3, 3), input_shape=(120, 160, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3)))
... | def get_model():
model = Sequential()
model.add(Lambda(lambda x: x * 1./255., input_shape=(120, 160, 3), output_shape=(120, 160, 3)))
model.add(Conv2D(32, (3, 3), input_shape=(120, 160, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3)))
... | en | 0.260105 | # this converts our 3D feature maps to 1D feature vectors # model.add(Dense(2)) # model.add(Activation('softmax')) # model.compile(loss='categorical_crossentropy', # optimizer='rmsprop', # metrics=['accuracy']) | 3.240985 | 3 |
items.py | legend-plus/LegendBot | 4 | 6630481 | <filename>items.py<gh_stars>1-10
class Item:
def __init__(self, base: str = "item", sprite: str = None, item_type: str = None, name: str = None,
description: str = None):
self.base = base
if sprite is not None:
self.sprite: str = sprite
if item_type is not None:
... | <filename>items.py<gh_stars>1-10
class Item:
def __init__(self, base: str = "item", sprite: str = None, item_type: str = None, name: str = None,
description: str = None):
self.base = base
if sprite is not None:
self.sprite: str = sprite
if item_type is not None:
... | none | 1 | 3.058458 | 3 | |
Final_project/PostBoard/Board/views.py | GregTMJ/django-files | 1 | 6630482 | from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from .models import Post, Author, Category, Comments, User
from django.views.generic import ListView, CreateView, UpdateView, Del... | from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from .models import Post, Author, Category, Comments, User
from django.views.generic import ListView, CreateView, UpdateView, Del... | en | 0.956133 | # Create your views here. # Here we are getting the id so Django could stalk the change # Here we are getting the id so Django could stalk the change | 2.01855 | 2 |
src/hashable.py | josephnavarro/ascii-art-generator | 0 | 6630483 | <gh_stars>0
#! usr/bin/env python3
"""
:
: Container class for a PIL Image. Allows image data to be hashable.
:
:
"""
from PIL import Image
import uuid
class HashableImage:
"""
:
: Hashable PIL Image container. Enables PIL image data to be used as dictionary keys.
:
:
: Attrs:
: I... | #! usr/bin/env python3
"""
:
: Container class for a PIL Image. Allows image data to be hashable.
:
:
"""
from PIL import Image
import uuid
class HashableImage:
"""
:
: Hashable PIL Image container. Enables PIL image data to be used as dictionary keys.
:
:
: Attrs:
: Image image :... | fr | 0.318407 | #! usr/bin/env python3 : : Container class for a PIL Image. Allows image data to be hashable. : : : : Hashable PIL Image container. Enables PIL image data to be used as dictionary keys. : : : Attrs: : Image image : Image object : UUID _hash : Uniquely hashable element : : #... | 3.518299 | 4 |
HW1/q3.py | wzcwzcwzc/ML | 0 | 6630484 | # -*- coding: utf-8 -*-
"""Q3.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nuVOMaV1Wr9RXpnbiyiNker8qGPQ86Nl
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# get 2-nd norms
def getNorms(arr):
norm = []... | # -*- coding: utf-8 -*-
"""Q3.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nuVOMaV1Wr9RXpnbiyiNker8qGPQ86Nl
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# get 2-nd norms
def getNorms(arr):
norm = []... | en | 0.865371 | # -*- coding: utf-8 -*- Q3.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1nuVOMaV1Wr9RXpnbiyiNker8qGPQ86Nl # get 2-nd norms # create and initialize covariance matrix d = 3 and sample_size = 10000 # generate 10000 random samples, 10000 is too muc... | 3.88354 | 4 |
stanCode_projects/my_drawing/my_drawing.py | shihjames/sc-projects | 0 | 6630485 | <gh_stars>0
"""
File: my_drawing.py
Name: <NAME>
----------------------
In this program, Karel the robot represents the students of stanCode,
and the beepers are what we have learned, what we are learning, and
what we will learn. When users click the mouse, Karel will move, this
means we are one step forward in becomin... | """
File: my_drawing.py
Name: <NAME>
----------------------
In this program, Karel the robot represents the students of stanCode,
and the beepers are what we have learned, what we are learning, and
what we will learn. When users click the mouse, Karel will move, this
means we are one step forward in becoming a professi... | en | 0.909421 | File: my_drawing.py Name: <NAME> ---------------------- In this program, Karel the robot represents the students of stanCode, and the beepers are what we have learned, what we are learning, and what we will learn. When users click the mouse, Karel will move, this means we are one step forward in becoming a professional... | 4.033796 | 4 |
setup.py | Naminwang/VBDiarization | 0 | 6630486 | <reponame>Naminwang/VBDiarization
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import urllib
import tarfile
import logging
import tempfile
from distutils.core import setup
from subprocess import check_c... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import urllib
import tarfile
import logging
import tempfile
from distutils.core import setup
from subprocess import check_call
from setuptools import find_pa... | en | 0.880046 | #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2018 Brno University of Technology FIT # Author: <NAME> <<EMAIL>> # All Rights Reserved Call cmd commands to install extra software/repositories. Args: directory (str): path # replace input of the last layer, so we can easily extract xvectors ... | 1.902782 | 2 |
old_versions/TCA_2_2/TCA_V_2_2_1/code/TCACore.py | OSADP/TCA | 1 | 6630487 | <reponame>OSADP/TCA
#standard
import math
import sys
import unittest
import time
import logging
import os
def set_logger(console_level = logging.INFO, file_level = logging.DEBUG, include_file = True, append_file = False):
if not append_file:
try:
os.remove('tca2.log')
except:
... | #standard
import math
import sys
import unittest
import time
import logging
import os
def set_logger(console_level = logging.INFO, file_level = logging.DEBUG, include_file = True, append_file = False):
if not append_file:
try:
os.remove('tca2.log')
except:
pass
logger... | en | 0.234517 | #standard #------------------------------------------------------------------------- #1 = linear distance #2 - Spherical distance #Earth radius in Miles #Convert to radians #------------------------------------------------------------------------- # (x1,y1) : Top left of rectangle, (x2,y2) : Bottom right of rectangle, ... | 2.777546 | 3 |
tests/fixtures/internal/subpackage_a/subpackage_1/module_i.py | gitter-badger/dependenpy | 10 | 6630488 | <reponame>gitter-badger/dependenpy
class ClassI(object):
from ..module_1 import Class1
def function():
from ...module_a import ClassA
def inner_function():
from ...subpackage_a.module_1 import Class1
class InnerClass(object):
from external import module_a
return inner_fu... | class ClassI(object):
from ..module_1 import Class1
def function():
from ...module_a import ClassA
def inner_function():
from ...subpackage_a.module_1 import Class1
class InnerClass(object):
from external import module_a
return inner_function | none | 1 | 2.683448 | 3 | |
tremendous/__init__.py | ryansb/tremendous | 0 | 6630489 | from tremendous.colors import __funcs
# This is gross. Sorry.
globals().update(__funcs)
| from tremendous.colors import __funcs
# This is gross. Sorry.
globals().update(__funcs)
| en | 0.949875 | # This is gross. Sorry. | 1.082042 | 1 |
src/comments/views.py | LABETE/srvup_and_drf | 0 | 6630490 | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView
from braces.views import LoginRequiredMixin
from comments.m... | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView
from braces.views import LoginRequiredMixin
from comments.m... | ru | 0.145106 | #print(self.get_object().get) | 2.065968 | 2 |
setup.py | jakirkham/dask-distance | 9 | 6630491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import setuptools
from setuptools import setup
from setuptools.command.test import test as TestCommand
import versioneer
class PyTest(TestCommand):
description = "Run test suite with pytest"
def finalize_options(self):
TestCommand.finalize_op... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import setuptools
from setuptools import setup
from setuptools.command.test import test as TestCommand
import versioneer
class PyTest(TestCommand):
description = "Run test suite with pytest"
def finalize_options(self):
TestCommand.finalize_op... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.719538 | 2 |
setup.py | Breakend/cule | 0 | 6630492 | <reponame>Breakend/cule
import argparse
import os
import sys
from Cython.Distutils import build_ext
from distutils.cmd import Command
from setuptools import find_packages, setup, Extension
from examples.utils.runtime import Runtime
try:
from examples.utils.runtime import get_device_props
codes = sorted(set([... | import argparse
import os
import sys
from Cython.Distutils import build_ext
from distutils.cmd import Command
from setuptools import find_packages, setup, Extension
from examples.utils.runtime import Runtime
try:
from examples.utils.runtime import get_device_props
codes = sorted(set([str(p.major) + str(p.min... | en | 0.832827 | Inject deep into distutils to customize how the dispatch to gcc/nvcc works. If you subclass UnixCCompiler, it's not trivial to get your subclass injected in, and still have the right customizations (i.e. distutils.sysconfig.customize_compiler) run on it. So instead of going the OO route, I have this... | 1.755793 | 2 |
loglib/change_detect.py | alanmitchell/mini-monitor | 7 | 6630493 | <reponame>alanmitchell/mini-monitor
"""Functions related to detecting and posting changes in
a set of sensor readings.
"""
def find_changes(vals, threshold=None, change_pct=0.02, max_interval=None):
"""Returns an array of index values that point at the values in the 'vals'
array that represent signficant chan... | """Functions related to detecting and posting changes in
a set of sensor readings.
"""
def find_changes(vals, threshold=None, change_pct=0.02, max_interval=None):
"""Returns an array of index values that point at the values in the 'vals'
array that represent signficant changes. 'threshold' is the absolute am... | en | 0.87073 | Functions related to detecting and posting changes in a set of sensor readings. Returns an array of index values that point at the values in the 'vals' array that represent signficant changes. 'threshold' is the absolute amount that a value must change before being included. If 'threshold' is None, 'cha... | 3.50892 | 4 |
zoo/vgg/vgg_c.py | sujeet-ap/keras-idiomatic-programmer | 3 | 6630494 | <reponame>sujeet-ap/keras-idiomatic-programmer<gh_stars>1-10
# Copyright 2019 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
#
... | # Copyright 2019 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.691981 | # Copyright 2019 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, ... | 1.860335 | 2 |
Python3/789.escape-the-ghosts.py | 610yilingliu/leetcode | 0 | 6630495 | #
# @lc app=leetcode id=789 lang=python3
#
# [789] Escape The Ghosts
#
# @lc code=start
class Solution:
def escapeGhosts(self, ghosts: List[List[int]], target: List[int]):
my_dist = abs(target[0]) + abs(target[1])
for ghost in ghosts:
curdist = abs(ghost[0] - target[0]) + abs(ghost[1] -... | #
# @lc app=leetcode id=789 lang=python3
#
# [789] Escape The Ghosts
#
# @lc code=start
class Solution:
def escapeGhosts(self, ghosts: List[List[int]], target: List[int]):
my_dist = abs(target[0]) + abs(target[1])
for ghost in ghosts:
curdist = abs(ghost[0] - target[0]) + abs(ghost[1] -... | en | 0.478972 | # # @lc app=leetcode id=789 lang=python3 # # [789] Escape The Ghosts # # @lc code=start # @lc code=end | 2.97045 | 3 |
test/discovery/test_stub.py | ezh/cloudselect | 4 | 6630496 | <gh_stars>1-10
# Copyright 2019 <NAME> and individual contributors
# See the LICENSE.txt file at the top-level directory of this distribution.
#
# Licensed under the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>
# This file may not be copied, modified, or distributed
# except according to those term... | # Copyright 2019 <NAME> and individual contributors
# See the LICENSE.txt file at the top-level directory of this distribution.
#
# Licensed under the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>
# This file may not be copied, modified, or distributed
# except according to those terms.
"""This modu... | en | 0.719138 | # Copyright 2019 <NAME> and individual contributors # See the LICENSE.txt file at the top-level directory of this distribution. # # Licensed under the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT> # This file may not be copied, modified, or distributed # except according to those terms. This module ... | 1.92073 | 2 |
EngVer/UpdateGoogleDrive.py | 0xf3cd/Chinese-Resume | 0 | 6630497 | import os
from pydrive import auth, drive
def UpdateFile(file_id, src_path):
f = drive.CreateFile({'id': file_id})
f.SetContentFile(src_path)
f.Upload()
def CreateFile(parent_folder_id, file_name, src_path):
f = drive.CreateFile({
'title': file_name,
'parents': [{'id': parent_folder_id}],
})
f.S... | import os
from pydrive import auth, drive
def UpdateFile(file_id, src_path):
f = drive.CreateFile({'id': file_id})
f.SetContentFile(src_path)
f.Upload()
def CreateFile(parent_folder_id, file_name, src_path):
f = drive.CreateFile({
'title': file_name,
'parents': [{'id': parent_folder_id}],
})
f.S... | en | 0.937672 | # Creates local webserver and auto handles authentication. # Create or update the resume # At this point, we can make sure that the .pdf file has not been uploaded yet | 2.761962 | 3 |
projects/VISOLO/visolo/visolo.py | SuHoHan95/VISOLO | 0 | 6630498 | <filename>projects/VISOLO/visolo/visolo.py<gh_stars>0
import math
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
import copy
import cv2
from scipy.ndimage.morphology import binary_dilation
from PIL import Image, ImageDraw, ImageFont
import os
from detectron2.modeling import META_A... | <filename>projects/VISOLO/visolo/visolo.py<gh_stars>0
import math
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
import copy
import cv2
from scipy.ndimage.morphology import binary_dilation
from PIL import Image, ImageDraw, ImageFont
import os
from detectron2.modeling import META_A... | en | 0.427679 | # B,S**2,1,H,W / B,C,1,S,S / B,1,S**2,S**2 # cat_scores_ori: K, v_l, 40 # N_pred_masks : dim, 1, H/4, W/4 # N_pred_kernels : dim, 1, S1, S2 # N_pred_cats : C, 1, S1, S2 # N_pred_tra : 1, S1*S2, S1*S2 # K, N, H, W # K, N # K, N # K, N, 40 # k0, S**2 # k0, k1 # k1, S**2 # pred_masks : dim, H/4, W/4 # pred_kernels : dim, ... | 1.903676 | 2 |
zlogging/enum/Tunnel.py | JarryShaw/zlogging | 0 | 6630499 | <gh_stars>0
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,import-error
"""Namespace: ``Tunnel``."""
from zlogging._compat import enum
@enum.unique
class Type(enum.IntFlag):
"""Enum: ``Tunnel::Type``.
See Also:
`base/bif/types.bif.zeek <https://docs.zeek.org/en/stable/scripts/base/bif/types... | # -*- coding: utf-8 -*-
# pylint: disable=line-too-long,import-error
"""Namespace: ``Tunnel``."""
from zlogging._compat import enum
@enum.unique
class Type(enum.IntFlag):
"""Enum: ``Tunnel::Type``.
See Also:
`base/bif/types.bif.zeek <https://docs.zeek.org/en/stable/scripts/base/bif/types.bif.zeek.ht... | en | 0.72016 | # -*- coding: utf-8 -*- # pylint: disable=line-too-long,import-error Namespace: ``Tunnel``. Enum: ``Tunnel::Type``. See Also: `base/bif/types.bif.zeek <https://docs.zeek.org/en/stable/scripts/base/bif/types.bif.zeek.html#type-Tunnel::Type>`__ Enum: ``Tunnel::Action``. Types of interesting activity tha... | 2.003443 | 2 |
examples/hello.py | concurrence/concurrence | 27 | 6630500 | <filename>examples/hello.py
from concurrence import dispatch
def hello():
print "Hello World!"
if __name__ == '__main__':
dispatch(hello)
| <filename>examples/hello.py
from concurrence import dispatch
def hello():
print "Hello World!"
if __name__ == '__main__':
dispatch(hello)
| none | 1 | 1.556847 | 2 | |
testing/example_scripts/dataclasses/test_compare_dataclasses.py | tinkerlin/pytest | 5,079 | 6630501 | <reponame>tinkerlin/pytest
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from dataclasses import field
def test_dataclasses():
@dataclass
class SimpleDataObject(object):
field_a: int = field()
field_b: int = field()
left = SimpleDataObject(1, "b")
right = SimpleDataObject(... | # -*- coding: utf-8 -*-
from dataclasses import dataclass
from dataclasses import field
def test_dataclasses():
@dataclass
class SimpleDataObject(object):
field_a: int = field()
field_b: int = field()
left = SimpleDataObject(1, "b")
right = SimpleDataObject(1, "c")
assert left ==... | en | 0.769321 | # -*- coding: utf-8 -*- | 3.067268 | 3 |
src/run_scripts/repro/dvc.py | prhuppertz/Burned_Area_Detection | 5 | 6630502 | <filename>src/run_scripts/repro/dvc.py
"""Usage:
dvc.py [--cache=<cache_path>] [--link=None] [--link2=None]
@ <NAME> & <NAME> 2020, Cervest
Creates symlinks/DVC structure
Options:
-h --help Show help.
--version Show version.
--cache=<cache_path> Inference mode. 'roi' or 'wsi'. ... | <filename>src/run_scripts/repro/dvc.py
"""Usage:
dvc.py [--cache=<cache_path>] [--link=None] [--link2=None]
@ <NAME> & <NAME> 2020, Cervest
Creates symlinks/DVC structure
Options:
-h --help Show help.
--version Show version.
--cache=<cache_path> Inference mode. 'roi' or 'wsi'. ... | en | 0.506802 | Usage: dvc.py [--cache=<cache_path>] [--link=None] [--link2=None] @ <NAME> & <NAME> 2020, Cervest Creates symlinks/DVC structure Options: -h --help Show help. --version Show version. --cache=<cache_path> Inference mode. 'roi' or 'wsi'. [default: data/] --link=<link> S... | 2.490375 | 2 |
utils/host_info.py | wanjun-group-seu/AQUARIUM | 0 | 6630503 | <gh_stars>0
# !/usr/bin/env python
# -*- coding:utf-8 -*-
# author : zerodel
# Readme:
#
import argparse
import os
import os.path
import sys
upper_root = os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
sys.path.append(upper_root)
import pysrc.sub_module.summary_quant as sq
parser = ar... | # !/usr/bin/env python
# -*- coding:utf-8 -*-
# author : zerodel
# Readme:
#
import argparse
import os
import os.path
import sys
upper_root = os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
sys.path.append(upper_root)
import pysrc.sub_module.summary_quant as sq
parser = argparse.Argum... | en | 0.549246 | # !/usr/bin/env python # -*- coding:utf-8 -*- # author : zerodel # Readme: # path to annotation file or quantification result directory with each sample has a final.gtf in its sub-dir summarize the host gene information from # print(entry_annotation) # for x in os.listdir(entry_annotati... | 2.239162 | 2 |
subir/query.py | xyla-io/subir | 0 | 6630504 | from data_layer import Redshift as SQL
from typing import Optional, Dict, List
class ColumnTypeQuery(SQL.GeneratedQuery, SQL.ResultQuery[Dict[str, str]]):
database: str
schema: str
table: str
def __init__(self, database: str, schema: str, table: str):
self.database = database
self.schema = schema
... | from data_layer import Redshift as SQL
from typing import Optional, Dict, List
class ColumnTypeQuery(SQL.GeneratedQuery, SQL.ResultQuery[Dict[str, str]]):
database: str
schema: str
table: str
def __init__(self, database: str, schema: str, table: str):
self.database = database
self.schema = schema
... | en | 0.290867 | select column_name, data_type, character_maximum_length from information_schema.columns where table_catalog = %s and table_schema = %s and table_name = %s; create table {self.schema}.{self.table} ( {columns_definition} ); create temporary table {self.upload_table} (like {self.schema}.{self.table} including defaults); t... | 2.638931 | 3 |
Hotel_Management_System_python/Registration.py | Mastermind-sap/HotelManagementSystem-python | 1 | 6630505 | <filename>Hotel_Management_System_python/Registration.py
import Hotel_Management_Software
class Registration:
def main(self):
print("")
print("\t\t\t\t\t\t\t\t\tRegistration")
print("\t\t\t\t\t\t\t\t\t************")
print("")
ob=Hotel_Management_Software()
g=0... | <filename>Hotel_Management_System_python/Registration.py
import Hotel_Management_Software
class Registration:
def main(self):
print("")
print("\t\t\t\t\t\t\t\t\tRegistration")
print("\t\t\t\t\t\t\t\t\t************")
print("")
ob=Hotel_Management_Software()
g=0... | en | 0.804681 | #Input for number of guests to be registered #input for the name of the guest to be registered #input for the gender of the guest to be registered #input for the age of the guest to be registered #input for the address of the guest to be registered #input for the PAN number of the guest to be registered #Take the syste... | 3.896387 | 4 |
server/products/models.py | tanvirtin/tinmart | 2 | 6630506 | <filename>server/products/models.py
from mongoengine import Document, StringField, IntField, DictField, FloatField, ListField
# model responsible for interacting with crawler_documents collection in walmartcrawler database in mongodb
class CrawlerDocument(Document):
docId = IntField()
url = StringField()
t... | <filename>server/products/models.py
from mongoengine import Document, StringField, IntField, DictField, FloatField, ListField
# model responsible for interacting with crawler_documents collection in walmartcrawler database in mongodb
class CrawlerDocument(Document):
docId = IntField()
url = StringField()
t... | en | 0.84403 | # model responsible for interacting with crawler_documents collection in walmartcrawler database in mongodb # model responsible for interacting with transaction collection in | 2.213203 | 2 |
http-bench/python_test.py | vieyahn2017/go-test | 0 | 6630507 | import pytest
import testutil
@pytest.mark.parametrize("variant", ["httplib", "requests"])
@pytest.mark.parametrize("blocksize", [
8, 32, 64, 128, 256, 512, 1024, 2048, 4096
])
def test_python(server, variant, blocksize):
print(testutil.upload(variant, testutil.SIZE_MB, blocksize))
@pytest.mark.parametrize(... | import pytest
import testutil
@pytest.mark.parametrize("variant", ["httplib", "requests"])
@pytest.mark.parametrize("blocksize", [
8, 32, 64, 128, 256, 512, 1024, 2048, 4096
])
def test_python(server, variant, blocksize):
print(testutil.upload(variant, testutil.SIZE_MB, blocksize))
@pytest.mark.parametrize(... | none | 1 | 2.001779 | 2 | |
psctb/utils/model_comparing.py | PySCeS/PyscesToolbox | 3 | 6630508 | import copy
import warnings
from os import path
import numpy as np
import pandas as pd
from pysces import Scanner, ParScanner
from pysces import model as pysces_model
from matplotlib import pyplot as plt
from .misc import scanner_range_setup, DotDict, cc_dict, rc_dict, ec_dict, prc_dict, is_parameter, is_species, \
... | import copy
import warnings
from os import path
import numpy as np
import pandas as pd
from pysces import Scanner, ParScanner
from pysces import model as pysces_model
from matplotlib import pyplot as plt
from .misc import scanner_range_setup, DotDict, cc_dict, rc_dict, ec_dict, prc_dict, is_parameter, is_species, \
... | en | 0.723177 | Returns a specified model comparer for a list of models. The returned model comparer object considers the first model in `model_list` as the "base model" to which the other models are compared. Since models may have a different naming scheme for reactions, species, etc. `model_mapping` allows the user ... | 2.256458 | 2 |
vipsevents/eventapp/apps.py | ACE-VSIT/vips-events | 0 | 6630509 | from django.apps import AppConfig
class EventappConfig(AppConfig):
name = 'vipsevents.eventapp'
| from django.apps import AppConfig
class EventappConfig(AppConfig):
name = 'vipsevents.eventapp'
| none | 1 | 1.079371 | 1 | |
dcorch/common/endpoint_cache.py | DadeCoderh/starlingx-stagingm | 1 | 6630510 | # Copyright 2015 Huawei Technologies Co., Ltd.
# 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
#
# Unl... | # Copyright 2015 Huawei Technologies Co., Ltd.
# 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
#
# Unl... | en | 0.87691 | # Copyright 2015 Huawei Technologies Co., Ltd. # 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 # # Unl... | 1.700357 | 2 |
checkov/secrets/runner.py | jasonckeating/checkov | 0 | 6630511 | import linecache
import logging
import os
import re
from typing import Optional, List
from detect_secrets import SecretsCollection
from detect_secrets.core import scan
from detect_secrets.core.potential_secret import PotentialSecret
from detect_secrets.settings import transient_settings
from typing_extensions import T... | import linecache
import logging
import os
import re
from typing import Optional, List
from detect_secrets import SecretsCollection
from detect_secrets.core import scan
from detect_secrets.core.potential_secret import PotentialSecret
from detect_secrets.settings import transient_settings
from typing_extensions import T... | en | 0.726259 | # 'Secret Keyword': 'CKV_SECRET_10', # Only run scans with only these plugins. # Implement non IaC files (including .terraform dir) # implemented the scan function like secrets.scan_files # Check for suppression comment in the line before, the line of, and the line after the secret | 1.497397 | 1 |
waymo_open_dataset/utils/box_utils_test.py | DKandrew/waymo-open-dataset | 8 | 6630512 | <gh_stars>1-10
# Copyright 2019 The Waymo Open Dataset 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
#
# Unl... | # Copyright 2019 The Waymo Open Dataset 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... | en | 0.809498 | # Copyright 2019 The Waymo Open Dataset 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... | 2.048139 | 2 |
FEArena/feaapi/models/play/ActiveUnit.py | Superbird11/FEArena | 1 | 6630513 | <filename>FEArena/feaapi/models/play/ActiveUnit.py
from django.db import models
from .._util import BaseModel
from ..build.BuiltUnit import BuiltUnit
from .ActiveWeapon import ActiveWeapon
from .ActiveItem import ActiveItem
from ..core import Skill
class ActiveUnit(BaseModel):
id: int = models.AutoField(primary_k... | <filename>FEArena/feaapi/models/play/ActiveUnit.py
from django.db import models
from .._util import BaseModel
from ..build.BuiltUnit import BuiltUnit
from .ActiveWeapon import ActiveWeapon
from .ActiveItem import ActiveItem
from ..core import Skill
class ActiveUnit(BaseModel):
id: int = models.AutoField(primary_k... | en | 0.790269 | # demographic information should be contained in the template unit # for skill use. This should be reset at the beginning of each turn. # otherwise, current state information # inventory (limit should be in template unit) # weapon rank modifiers # temporary skills # extract all_classes to its own variable at once, to k... | 2.130676 | 2 |
src/cryptography/hazmat/primitives/serialization/ssh.py | Capfly/cryptography | 1 | 6630514 | <reponame>Capfly/cryptography<gh_stars>1-10
# 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.
import binascii
import os
import re
import typing
from base64 import encodebytes as _base64_en... | # 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.
import binascii
import os
import re
import typing
from base64 import encodebytes as _base64_encode
from cryptography import utils
from cr... | en | 0.713052 | # 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. # re is only way to work on bytes-like data # padding for max blocksize # ciphers that are actually used in key wrapping # map local curve n... | 2.102288 | 2 |
examples/hacker_news/hacker_news/legacy/repo.py | geoHeil/dagster | 0 | 6630515 | from dagster import repository
from ..schedules.hourly_hn_download_schedule import hourly_hn_download_schedule
from ..sensors.download_pipeline_finished_sensor import dbt_on_hn_download_finished
from ..sensors.hn_tables_updated_sensor import story_recommender_on_hn_table_update
from ..sensors.slack_on_failure_sensor i... | from dagster import repository
from ..schedules.hourly_hn_download_schedule import hourly_hn_download_schedule
from ..sensors.download_pipeline_finished_sensor import dbt_on_hn_download_finished
from ..sensors.hn_tables_updated_sensor import story_recommender_on_hn_table_update
from ..sensors.slack_on_failure_sensor i... | en | 0.494526 | # Creates a hacker news reference repository using the legacy dagster APIs of pipeline, solid, # and mode. | 1.866747 | 2 |
clean_mws.py | Wonqu/SMAA2019_Team5 | 0 | 6630516 | <gh_stars>0
import uuid
from extract_sentences import extract_sentences, extract_chapters
FRANKENSTEIN_CHAPTERS = {
x.upper().strip() for x in
"""Letter 1
Letter 2
Letter 3
Letter 4
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapte... | import uuid
from extract_sentences import extract_sentences, extract_chapters
FRANKENSTEIN_CHAPTERS = {
x.upper().strip() for x in
"""Letter 1
Letter 2
Letter 3
Letter 4
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
... | en | 0.682626 | Letter 1 Letter 2 Letter 3 Letter 4 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 ... | 2.689702 | 3 |
rhea/vendor/_output_serdes.py | meetps/rhea | 1 | 6630517 | <filename>rhea/vendor/_output_serdes.py
from myhdl import Signal, intbv, concat, always, always_comb
from . import SERDESInterface
| <filename>rhea/vendor/_output_serdes.py
from myhdl import Signal, intbv, concat, always, always_comb
from . import SERDESInterface
| none | 1 | 1.30917 | 1 | |
bayesmark/xgb_cuml.py | daxiongshu/bayesmark | 3 | 6630518 | <filename>bayesmark/xgb_cuml.py<gh_stars>1-10
import xgboost as xgb
import cupy as cp
from cuml.preprocessing.model_selection import train_test_split
def get_default_params():
return {
'objective': 'multi:softprob',
'eval_metric': 'mlogloss',
'tree_method': 'gpu_hist',
... | <filename>bayesmark/xgb_cuml.py<gh_stars>1-10
import xgboost as xgb
import cupy as cp
from cuml.preprocessing.model_selection import train_test_split
def get_default_params():
return {
'objective': 'multi:softprob',
'eval_metric': 'mlogloss',
'tree_method': 'gpu_hist',
... | en | 0.247735 | #ext_params = ['early_stopping', 'early_stopping_rounds', # 'n_estimators', 'silent', 'validation_fraction', 'verbose'] | 2.249122 | 2 |
netnir/plugins/facts.py | jtdub/netnir | 0 | 6630519 | from nornir.core.task import Task, Result
from typing import Any
def inventory_facts(task: Task, **kwargs: Any) -> Result:
"""gather inventory facts
:params task: type object
:returns: inventory host facts dictionary
"""
return Result(
host=task.host, result={"facts": task.host.data, "gr... | from nornir.core.task import Task, Result
from typing import Any
def inventory_facts(task: Task, **kwargs: Any) -> Result:
"""gather inventory facts
:params task: type object
:returns: inventory host facts dictionary
"""
return Result(
host=task.host, result={"facts": task.host.data, "gr... | en | 0.51312 | gather inventory facts :params task: type object :returns: inventory host facts dictionary | 2.334316 | 2 |
microcosm_flask/tests/conventions/test_create_collection_conflict.py | Sinon/microcosm-flask | 11 | 6630520 | from hamcrest import assert_that, calling, raises
from marshmallow import Schema
from microcosm.api import create_object_graph
from microcosm_flask.conventions.base import EndpointDefinition, RouteAlreadyRegisteredException
from microcosm_flask.conventions.crud import configure_crud
from microcosm_flask.namespaces imp... | from hamcrest import assert_that, calling, raises
from marshmallow import Schema
from microcosm.api import create_object_graph
from microcosm_flask.conventions.base import EndpointDefinition, RouteAlreadyRegisteredException
from microcosm_flask.conventions.crud import configure_crud
from microcosm_flask.namespaces imp... | none | 1 | 2.114926 | 2 | |
scripts/recon_enum3/nfsrecon.py | r4b3rt/OSCPRepo | 2,109 | 6630521 | #!/usr/bin/python
import sys
import os
import subprocess
import argparse
import errno
import pathlib
# TODO: this relied on nfspy to do certain checks. Look into dockerizing nfspy and re-implementing
# mkdir_p function updated for >= python 3.5
def mkdir_p(path):
pathlib.Path(path).mkdir(parents=True, exist_ok=... | #!/usr/bin/python
import sys
import os
import subprocess
import argparse
import errno
import pathlib
# TODO: this relied on nfspy to do certain checks. Look into dockerizing nfspy and re-implementing
# mkdir_p function updated for >= python 3.5
def mkdir_p(path):
pathlib.Path(path).mkdir(parents=True, exist_ok=... | en | 0.709396 | #!/usr/bin/python # TODO: this relied on nfspy to do certain checks. Look into dockerizing nfspy and re-implementing # mkdir_p function updated for >= python 3.5 #Running #nfs-ls: Attempts to get useful info about files from NFS Exports #nfs-showmount: Show NFS explorts like 'showmount -e' #nfs-statfs: Retrieves disk s... | 2.335058 | 2 |
stacked_capsule_autoencoders/capsules/data/constellation.py | rmitra/google-research | 1 | 6630522 | <gh_stars>1-10
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | en | 0.793324 | # coding=utf-8 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab... | 2.144808 | 2 |
examples/matplotlib/mpl_plot_kde_2d_hdi.py | sudojarvis/arviz | 1,159 | 6630523 | <reponame>sudojarvis/arviz
"""
2d KDE with HDI Contours
========================
_thumb: .5, .8
_example_title: 2d KDE with HDI Contours
"""
import matplotlib.pyplot as plt
import numpy as np
import arviz as az
az.style.use("arviz-darkgrid")
rng = np.random.default_rng()
data = rng.multivariate_normal([2, 2], [[1, ... | """
2d KDE with HDI Contours
========================
_thumb: .5, .8
_example_title: 2d KDE with HDI Contours
"""
import matplotlib.pyplot as plt
import numpy as np
import arviz as az
az.style.use("arviz-darkgrid")
rng = np.random.default_rng()
data = rng.multivariate_normal([2, 2], [[1, 0.4], [0.4, 0.8]], 1000000)... | en | 0.556357 | 2d KDE with HDI Contours ======================== _thumb: .5, .8 _example_title: 2d KDE with HDI Contours # 1, 2 and 3 sigma contours | 2.507939 | 3 |
setup.py | himanshu-dutta/pycoder | 1 | 6630524 | <reponame>himanshu-dutta/pycoder
from setuptools import setup, find_packages
from pycoder.version import __version__
from pathlib import Path
PACKAGE_DIR = (Path(__file__).parent / "pycoder").absolute()
HTML_PATH = PACKAGE_DIR / "api" / "index.html"
if not HTML_PATH.exists():
raise FileNotFoundError(HTML_PATH)
w... | from setuptools import setup, find_packages
from pycoder.version import __version__
from pathlib import Path
PACKAGE_DIR = (Path(__file__).parent / "pycoder").absolute()
HTML_PATH = PACKAGE_DIR / "api" / "index.html"
if not HTML_PATH.exists():
raise FileNotFoundError(HTML_PATH)
with open("README.md") as f:
l... | none | 1 | 2.045601 | 2 | |
VUsbTools/Style.py | scanlime/vusb-analyzer | 34 | 6630525 | <filename>VUsbTools/Style.py
#
# VUsbTools.Views
# <NAME> <<EMAIL>>
#
# A container for color and font preferences
#
# Copyright (C) 2005-2010 VMware, Inc. Licensed under the MIT
# License, please see the README.txt. All rights reserved.
#
import math
from VUsbTools.Types import Color
#
# Use the default monospace fo... | <filename>VUsbTools/Style.py
#
# VUsbTools.Views
# <NAME> <<EMAIL>>
#
# A container for color and font preferences
#
# Copyright (C) 2005-2010 VMware, Inc. Licensed under the MIT
# License, please see the README.txt. All rights reserved.
#
import math
from VUsbTools.Types import Color
#
# Use the default monospace fo... | en | 0.670161 | # # VUsbTools.Views # <NAME> <<EMAIL>> # # A container for color and font preferences # # Copyright (C) 2005-2010 VMware, Inc. Licensed under the MIT # License, please see the README.txt. All rights reserved. # # # Use the default monospace font. If this is too large/small for your # tastes, you can try a specific fon... | 2.272134 | 2 |
tests/test_pep8.py | sdrees/jupytext | 11 | 6630526 | import pytest
from nbformat.v4.nbbase import new_code_cell, new_notebook
from jupytext import read, reads, writes
from jupytext.compare import compare
from jupytext.pep8 import (
cell_ends_with_code,
cell_ends_with_function_or_class,
cell_has_code,
next_instruction_is_function_or_class,
pep8_lines_... | import pytest
from nbformat.v4.nbbase import new_code_cell, new_notebook
from jupytext import read, reads, writes
from jupytext.compare import compare
from jupytext.pep8 import (
cell_ends_with_code,
cell_ends_with_function_or_class,
cell_has_code,
next_instruction_is_function_or_class,
pep8_lines_... | en | 0.664204 | @pytest.mark.parametrize('py_file', [py_file for py_file in list_notebooks('../jupytext') + list_notebooks('.') if py_file.endswith('.py')]) def test_no_metadata_when_py_is_pep8(py_file): pass class A: __init__(): '''A docstring with two lines or more''' self... | 2.723639 | 3 |
Module/dnsrecon/lib/gooenum.py | vishnudxb/Yuki-Chan-The-Auto-Pentest | 655 | 6630527 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; Applies version 2 of the License.
#
# This program is... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; Applies version 2 of the License.
#
# This program is... | en | 0.814775 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2010 <NAME> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; Applies version 2 of the License. # # This program is ... | 2.7092 | 3 |
scripts/house_contacts.py | jeffgeee/congress-legislators | 0 | 6630528 | <gh_stars>0
#!/usr/bin/env python
# Update current congressmember's contact info from clerk XML feed
import requests
import lxml
import re
from datetime import datetime
from utils import load_data, save_data, parse_date
def run():
today = datetime.now().date()
y = load_data("legislators-current.yaml")
# TODO u... | #!/usr/bin/env python
# Update current congressmember's contact info from clerk XML feed
import requests
import lxml
import re
from datetime import datetime
from utils import load_data, save_data, parse_date
def run():
today = datetime.now().date()
y = load_data("legislators-current.yaml")
# TODO use download ... | en | 0.538497 | #!/usr/bin/env python # Update current congressmember's contact info from clerk XML feed # TODO use download util? # TODO: Follow up #print(query_str) # for now, no automatic name updates since there is disagremeent on how to handle # firstname = mi.find('firstname').text # middlename = mi.find('middlename').text #coul... | 2.831433 | 3 |
ScopusScrapus/ScopusSearch.py | neoflex/ScopusScrapus | 1 | 6630529 | <reponame>neoflex/ScopusScrapus
import requests as r
import urllib.parse as purl
import json
def StartScopusSearch(key, params):
ssq = ScopusSearchQuery(key, params)
return ssq
class ScopusSearchQuery:
_defaultParams = {'count': 100,
'view': 'COMPLETE',
'httpA... | import requests as r
import urllib.parse as purl
import json
def StartScopusSearch(key, params):
ssq = ScopusSearchQuery(key, params)
return ssq
class ScopusSearchQuery:
_defaultParams = {'count': 100,
'view': 'COMPLETE',
'httpAccept': 'application/json'}
... | en | 0.476615 | # Return (self._data[self._i-1], self._apiKey) instead of self._data[self._i-1] # If we fail again, we surrender # If Invalid API Key or exceeding quota for the API Key, change it # Fix this # KeyError hazard: If no 'next' url is available, we need to error out anyway # Nasty? Sorry : ) # Returning only the obtained re... | 2.937572 | 3 |
django_smartfarm_git/main/migrations/0006_remove_temp_date.py | jyjy318/smartfarm | 0 | 6630530 | # Generated by Django 2.0.13 on 2020-09-03 13:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20200903_2215'),
]
operations = [
migrations.RemoveField(
model_name='temp',
name='date',
),
... | # Generated by Django 2.0.13 on 2020-09-03 13:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20200903_2215'),
]
operations = [
migrations.RemoveField(
model_name='temp',
name='date',
),
... | en | 0.831999 | # Generated by Django 2.0.13 on 2020-09-03 13:19 | 1.302781 | 1 |
server/grade_view/blue_prints/register.py | jw3329/grade-view | 0 | 6630531 | <filename>server/grade_view/blue_prints/register.py
from flask import Blueprint, request, jsonify
from flask_login import login_required, current_user
from grade_view import db, app
from grade_view.models import User, Course, GPA, Major
register = Blueprint('register', __name__)
@register.route('/gpa',methods=['GET',... | <filename>server/grade_view/blue_prints/register.py
from flask import Blueprint, request, jsonify
from flask_login import login_required, current_user
from grade_view import db, app
from grade_view.models import User, Course, GPA, Major
register = Blueprint('register', __name__)
@register.route('/gpa',methods=['GET',... | en | 0.735311 | # handle course number if it is more than 3 digits # if there's no filter result, then add it # after commit, add gpa data # handle error case if the grade does not belong to the category | 2.915622 | 3 |
tests/beacon/test_aggregation.py | Bhargavasomu/py-evm | 0 | 6630532 | <reponame>Bhargavasomu/py-evm
import pytest
from hypothesis import (
given,
settings,
strategies as st,
)
from eth._utils import bls
from eth._utils.bitfield import (
get_empty_bitfield,
has_voted,
)
from eth.beacon.aggregation import (
aggregate_votes,
verify_votes,
)
@settings(max_examp... | import pytest
from hypothesis import (
given,
settings,
strategies as st,
)
from eth._utils import bls
from eth._utils.bitfield import (
get_empty_bitfield,
has_voted,
)
from eth.beacon.aggregation import (
aggregate_votes,
verify_votes,
)
@settings(max_examples=1)
@given(random=st.random... | en | 0.649237 | # Get votes: (committee_index, sig, public_key) # Verify # Aggregate the votes | 2.248288 | 2 |
problem0055.py | kmarcini/Project-Euler-Python | 0 | 6630533 | ###########################
#
# #55 Lychrel numbers - Project Euler
# https://projecteuler.net/problem=55
#
# Code by <NAME>
#
###########################
| ###########################
#
# #55 Lychrel numbers - Project Euler
# https://projecteuler.net/problem=55
#
# Code by <NAME>
#
###########################
| de | 0.362785 | ########################### # # #55 Lychrel numbers - Project Euler # https://projecteuler.net/problem=55 # # Code by <NAME> # ########################### | 1.126742 | 1 |
migrations/versions/e9f614a8dce6_.py | Ahmad-Zaky/fuyyr_udacity_proj | 0 | 6630534 | """empty message
Revision ID: e9f614a8dce6
Revises: <PASSWORD>
Create Date: 2021-02-28 05:23:44.254402
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e9f614a8dce6'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | """empty message
Revision ID: e9f614a8dce6
Revises: <PASSWORD>
Create Date: 2021-02-28 05:23:44.254402
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e9f614a8dce6'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | en | 0.472817 | empty message Revision ID: e9f614a8dce6 Revises: <PASSWORD> Create Date: 2021-02-28 05:23:44.254402 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic comma... | 1.847127 | 2 |
test_flood.py | henrywall56/Lab-Group-1-U-H | 0 | 6630535 | <reponame>henrywall56/Lab-Group-1-U-H
from numpy import float32
from floodsystem.flood import stations_level_over_threshold, stations_highest_rel_level
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.station import MonitoringStation
def test_stations_level_over_threshold():... | from numpy import float32
from floodsystem.flood import stations_level_over_threshold, stations_highest_rel_level
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.station import MonitoringStation
def test_stations_level_over_threshold(): #checking the output of the function... | en | 0.909578 | #checking the output of the function is as intended | 2.844965 | 3 |
binstar_client/inspect_package/tests/test_pypi.py | rpk101/anaconda-client | 98 | 6630536 | from __future__ import print_function, unicode_literals
import os
import shutil
import tempfile
import unittest
from pprint import pprint
from binstar_client.inspect_package import pypi
from binstar_client.utils.test.utils import data_dir
expected_package_data = {'name': 'test-package34',
'l... | from __future__ import print_function, unicode_literals
import os
import shutil
import tempfile
import unittest
from pprint import pprint
from binstar_client.inspect_package import pypi
from binstar_client.utils.test.utils import data_dir
expected_package_data = {'name': 'test-package34',
'l... | en | 0.897283 | # If we could create this file, we ought to be able to delete it # We created a temporary directory like /tmp/has-dash, delete it # import sys;sys.argv = ['', 'Test.testName'] | 1.909 | 2 |
uspto_tools/parse/__init__.py | clicumu/uspto-tools | 0 | 6630537 | <reponame>clicumu/uspto-tools
from . import aps, patent, patft_html, sgml, xml | from . import aps, patent, patft_html, sgml, xml | none | 1 | 1.057074 | 1 | |
src/tools.py/mapKeyboard.py | Mambix/Keyduino | 3 | 6630538 | <filename>src/tools.py/mapKeyboard.py
#!/usr/bin/env python
# Filename: mapKeyboard.py
'''
Created on 24 Jul 2016
@author: <EMAIL>
'''
import serial
import json
keys = {}
if __name__ == '__main__':
ser = serial.Serial('COM9', 115200)
cnt = 0
try:
if ser.is_open == False:
ser.open()
while cnt<100:
ln... | <filename>src/tools.py/mapKeyboard.py
#!/usr/bin/env python
# Filename: mapKeyboard.py
'''
Created on 24 Jul 2016
@author: <EMAIL>
'''
import serial
import json
keys = {}
if __name__ == '__main__':
ser = serial.Serial('COM9', 115200)
cnt = 0
try:
if ser.is_open == False:
ser.open()
while cnt<100:
ln... | en | 0.29883 | #!/usr/bin/env python # Filename: mapKeyboard.py Created on 24 Jul 2016 @author: <EMAIL> # ln3 = ser.readline() # ln4 = ser.readline() # , ln3, ln4] | 2.597744 | 3 |
test_pypasshash.py | NeverMine17/pypasshash | 0 | 6630539 | <gh_stars>0
import unittest
import pypasshash
tests_version_1 = [
['test123', 'asd', 'w9XHj6TXSSC4'],
['qwerty', 'qwerty', 't8BvIfZIqw8i'],
['123', '123', 'd7JCE8mdIksv'],
['12345', '12345', 'f8Ew2fPdXNDB'],
['5agRrdKKPFWkT3pj5dwNddyA', 'jbuHzWA4ch7h73KugVHtqv6r', 'q1RjFnRTw2gq'],
['3VaY2WPxpfZ... | import unittest
import pypasshash
tests_version_1 = [
['test123', 'asd', 'w9XHj6TXSSC4'],
['qwerty', 'qwerty', 't8BvIfZIqw8i'],
['123', '123', 'd7JCE8mdIksv'],
['12345', '12345', 'f8Ew2fPdXNDB'],
['5agRrdKKPFWkT3pj5dwNddyA', 'jbuHzWA4ch7h73KugVHtqv6r', 'q1RjFnRTw2gq'],
['3VaY2WPxpfZU6z25MWhdexs... | none | 1 | 1.867559 | 2 | |
VelodyneHDL/python/veloview/applogic.py | yajin1126/C-Users-yajin-Documents-veloview | 0 | 6630540 | <filename>VelodyneHDL/python/veloview/applogic.py
# Copyright 2013 Velodyne Acoustics, 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
... | <filename>VelodyneHDL/python/veloview/applogic.py
# Copyright 2013 Velodyne Acoustics, 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
... | en | 0.791256 | # Copyright 2013 Velodyne Acoustics, 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... | 1.860877 | 2 |
examples/example_mapping.py | JulienLefevreMars/slam | 6 | 6630541 | """
.. _example_mapping:
===================================
Mapping example in slam
===================================
"""
# Authors:
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 2
#############################################################################... | """
.. _example_mapping:
===================================
Mapping example in slam
===================================
"""
# Authors:
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 2
#############################################################################... | de | 0.540745 | .. _example_mapping: =================================== Mapping example in slam =================================== # Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 2 ############################################################################### # Importa... | 2.721205 | 3 |
reinforce/jax2.py | gebob19/rl_with_jax | 5 | 6630542 | ## different implementation version of batch REINFORCE (still works and is 2x faster)
#%%
import jax
import jax.numpy as np
import numpy as onp
import distrax
import optax
import gym
from functools import partial
from jax.config import config
config.update("jax_enable_x64", True)
config.update("jax_debug_nans", ... | ## different implementation version of batch REINFORCE (still works and is 2x faster)
#%%
import jax
import jax.numpy as np
import numpy as onp
import distrax
import optax
import gym
from functools import partial
from jax.config import config
config.update("jax_enable_x64", True)
config.update("jax_debug_nans", ... | en | 0.448458 | ## different implementation version of batch REINFORCE (still works and is 2x faster) #%% # break on nans #%% #%% # # %% # dummy input ## optimizers # %% # %% # %% # %% # %% | 1.871264 | 2 |
env/lib/python3.8/site-packages/faker/providers/internet/ru_RU/__init__.py | avdhari/enigma | 258 | 6630543 | <filename>env/lib/python3.8/site-packages/faker/providers/internet/ru_RU/__init__.py
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
user_name_formats = (
'{{last_name_female}}.{{first_name_female}}',
'{{last_name... | <filename>env/lib/python3.8/site-packages/faker/providers/internet/ru_RU/__init__.py
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
user_name_formats = (
'{{last_name_female}}.{{first_name_female}}',
'{{last_name... | zh | 0.286321 | # coding=utf-8 ##', ##', | 1.990412 | 2 |
project/test/date_range_test.py | majvazov/martin-ayvazov-employees | 0 | 6630544 | import unittest
import sys
#step back one directory
sys.path.append("..")
#import all functions in functions.py
from packages.functions import (date_range_overlap,
find_longest_time_couple,
find_all_ranges,
read_file)
class... | import unittest
import sys
#step back one directory
sys.path.append("..")
#import all functions in functions.py
from packages.functions import (date_range_overlap,
find_longest_time_couple,
find_all_ranges,
read_file)
class... | en | 0.665933 | #step back one directory #import all functions in functions.py Automated test scripts for functions in functions.py Unit testing date_range_overlap function used for detecting range in days between two date ranges #excepting integer values given as arguments To do To do To do | 3.218003 | 3 |
dxm/lib/DxTable/DxMetaList.py | arunbsar/dxm-toolkit | 0 | 6630545 | #
# 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 ... | #
# 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 ... | en | 0.750646 | # # 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 ... | 1.835967 | 2 |
tests/unit/resources/test_factory.py | nglange/ibm-cos-sdk-python | 33 | 6630546 | <reponame>nglange/ibm-cos-sdk-python
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/... | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file accompa... | en | 0.896204 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the 'license' file accompa... | 1.822501 | 2 |
utils/Geometry.py | albertdow/zinv-analysis | 0 | 6630547 | import numpy as np
import numba as nb
@nb.vectorize
def BoundPhi(phi):
if phi >= np.pi:
phi -= 2*np.pi
elif phi < -np.pi:
phi += 2*np.pi
return phi
@nb.njit
def DeltaR2(deta, dphi):
return deta**2 + BoundPhi(dphi)**2
@nb.njit
def RadToCart2D(r, phi):
return r*np.cos(phi), r*np.sin... | import numpy as np
import numba as nb
@nb.vectorize
def BoundPhi(phi):
if phi >= np.pi:
phi -= 2*np.pi
elif phi < -np.pi:
phi += 2*np.pi
return phi
@nb.njit
def DeltaR2(deta, dphi):
return deta**2 + BoundPhi(dphi)**2
@nb.njit
def RadToCart2D(r, phi):
return r*np.cos(phi), r*np.sin... | none | 1 | 2.477593 | 2 | |
Data Preparation Layer/Data Enchichment_ML prep_Outlier Detection module/modelling_main.py | marcroiglama/GIVO | 1 | 6630548 | from __future__ import division, print_function
import numpy as np
import pandas as pd
from sklearn.externals import joblib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import modelling_functions as mf
def mainEvaluateInterpolation():
# 1.Get spark data and transform to pandas df
df = ... | from __future__ import division, print_function
import numpy as np
import pandas as pd
from sklearn.externals import joblib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import modelling_functions as mf
def mainEvaluateInterpolation():
# 1.Get spark data and transform to pandas df
df = ... | en | 0.561146 | # 1.Get spark data and transform to pandas df # 2. Create a validation set with some extra NaNs # 3. Interpolate to fill blanks # 4. Compare results of the df_ip_validate and original df # 5. Select to best method to apply to the data and keep these values #6. Show results # 7. Save modified data (UNCOMMENT!) df_full =... | 3.051198 | 3 |
redpanda/examples/python/kafka-produce.py | lbooker42/deephaven-core | 0 | 6630549 | <reponame>lbooker42/deephaven-core
#
# Test driver to produce kafka messages using single type serializers for key and value.
#
# To run this script, you need confluent-kafka libraries installed.
# To create a dedicated venv for it, you can do:
#
# $ mkdir confluent-kafka; cd confluent-kafka
# $ python3 -m venv conflue... | #
# Test driver to produce kafka messages using single type serializers for key and value.
#
# To run this script, you need confluent-kafka libraries installed.
# To create a dedicated venv for it, you can do:
#
# $ mkdir confluent-kafka; cd confluent-kafka
# $ python3 -m venv confluent-kafka
# $ cd confluent-kafka
# $... | en | 0.440194 | # # Test driver to produce kafka messages using single type serializers for key and value. # # To run this script, you need confluent-kafka libraries installed. # To create a dedicated venv for it, you can do: # # $ mkdir confluent-kafka; cd confluent-kafka # $ python3 -m venv confluent-kafka # $ cd confluent-kafka # $... | 2.360703 | 2 |
utils/__init__.py | thearyadev/Python-Console-Logging | 0 | 6630550 | from .console import Console
| from .console import Console
| none | 1 | 1.054096 | 1 |