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 |
|---|---|---|---|---|---|---|---|---|---|---|
sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py | rsdoherty/azure-sdk-for-python | 2,728 | 6630551 | <filename>sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py<gh_stars>1000+
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for lice... | <filename>sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py<gh_stars>1000+
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for lice... | en | 0.758258 | # 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 may ... | 1.977314 | 2 |
ENV/lib/python3.6/site-packages/plaster/interfaces.py | captain-c00keys/pyramid-stocks | 0 | 6630552 | import abc
from .compat import add_metaclass
@add_metaclass(abc.ABCMeta)
class ILoader(object):
"""
An abstraction over an source of configuration settings.
It is required to implement ``get_sections``, ``get_settings`` and
``setup_logging``.
Optionally, it may also implement other :term:`loade... | import abc
from .compat import add_metaclass
@add_metaclass(abc.ABCMeta)
class ILoader(object):
"""
An abstraction over an source of configuration settings.
It is required to implement ``get_sections``, ``get_settings`` and
``setup_logging``.
Optionally, it may also implement other :term:`loade... | en | 0.652198 | An abstraction over an source of configuration settings. It is required to implement ``get_sections``, ``get_settings`` and ``setup_logging``. Optionally, it may also implement other :term:`loader protocol` interfaces to provide extra functionality. For example, :class:`plaster.protocols.IWSGIProt... | 2.894787 | 3 |
anthill/platform/api/rest/handlers/detail.py | 0x55AAh/anthill_gaming | 1 | 6630553 | <gh_stars>1-10
from anthill.framework.handlers import RequestHandler, JSONHandlerMixin
from anthill.framework.utils.asynchronous import thread_pool_exec
from anthill.framework.core.exceptions import ImproperlyConfigured
from anthill.framework.http import Http404
from anthill.platform.api.rest.handlers.base import Marsh... | from anthill.framework.handlers import RequestHandler, JSONHandlerMixin
from anthill.framework.utils.asynchronous import thread_pool_exec
from anthill.framework.core.exceptions import ImproperlyConfigured
from anthill.framework.http import Http404
from anthill.platform.api.rest.handlers.base import MarshmallowMixin
c... | en | 0.85309 | Provide the ability to retrieve a single object for further manipulation. Return the object the handler is displaying. Require `self.queryset` and a `pk` or `slug` argument in the url entry. Subclasses can override this to return any object. # Use a custom queryset if provided. # Next, try looking up b... | 2.028302 | 2 |
homeassistant/components/camera/prefs.py | MrDelik/core | 22,481 | 6630554 | """Preference management for camera component."""
from __future__ import annotations
from typing import Final
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import UNDEFINED, UndefinedType
from .const import DOMAIN, PREF_PRELOAD_STREAM
STORAGE_KEY: Final = DOMAIN
STORAGE_VERSION: Fin... | """Preference management for camera component."""
from __future__ import annotations
from typing import Final
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import UNDEFINED, UndefinedType
from .const import DOMAIN, PREF_PRELOAD_STREAM
STORAGE_KEY: Final = DOMAIN
STORAGE_VERSION: Fin... | en | 0.76769 | Preference management for camera component. Handle preferences for camera entity. Initialize prefs. Return dictionary version. Return if stream is loaded on hass start. Handle camera preferences. Initialize camera prefs. Finish initializing the preferences. Update camera preferences. # Prefs already initialized. Get pr... | 2.258393 | 2 |
dfwinreg/__init__.py | ict/dfwinreg | 0 | 6630555 | # -*- coding: utf-8 -*-
"""Digital Forensics Windows Registry (dfWinReg).
dfWinReg, or Digital Forensics Windows Registry, is a Python module
that provides read-only access to Windows Registry objects.
"""
__version__ = '20200211'
| # -*- coding: utf-8 -*-
"""Digital Forensics Windows Registry (dfWinReg).
dfWinReg, or Digital Forensics Windows Registry, is a Python module
that provides read-only access to Windows Registry objects.
"""
__version__ = '20200211'
| en | 0.623631 | # -*- coding: utf-8 -*- Digital Forensics Windows Registry (dfWinReg). dfWinReg, or Digital Forensics Windows Registry, is a Python module that provides read-only access to Windows Registry objects. | 1.370818 | 1 |
plugins/ctags_generator/test_ctags_generator.py | likev/gauravssnl.github.io | 2 | 6630556 | # -*- coding: utf-8 -*-
import os, shutil
from pelican.generators import ArticlesGenerator
from pelican.tests.support import get_settings, unittest
from pelican.writers import Writer
from ctags_generator import generate_ctags
CUR_DIR = os.path.dirname(__file__)
TEST_CONTENT_DIR = os.path.join(CUR_DIR, 'test_content... | # -*- coding: utf-8 -*-
import os, shutil
from pelican.generators import ArticlesGenerator
from pelican.tests.support import get_settings, unittest
from pelican.writers import Writer
from ctags_generator import generate_ctags
CUR_DIR = os.path.dirname(__file__)
TEST_CONTENT_DIR = os.path.join(CUR_DIR, 'test_content... | en | 0.773322 | # -*- coding: utf-8 -*- # output content is correct | 2.214304 | 2 |
PublicConfig.py | CzechGlobe/MeteoDataMiner | 0 | 6630557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
class Configuration(object):
LINKS_ARRAY = ['http://www.emsbrno.cz/p.axd/cs/%C5%BDab%C4%8Dice.PPS.MZLUUAB.html',
'http://www.emsbrno.cz/p.axd/cs/Vigantice.MZLUUAB.html',
'http://www.emsbrno.cz/p.axd/cs/Marchegg.M... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
class Configuration(object):
LINKS_ARRAY = ['http://www.emsbrno.cz/p.axd/cs/%C5%BDab%C4%8Dice.PPS.MZLUUAB.html',
'http://www.emsbrno.cz/p.axd/cs/Vigantice.MZLUUAB.html',
'http://www.emsbrno.cz/p.axd/cs/Marchegg.M... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.785385 | 2 |
tests/unit/test_utils.py | ITV/aws-scheduled-event-adjuster | 1 | 6630558 | <reponame>ITV/aws-scheduled-event-adjuster
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import pytest
from lib import utils
def test_get_tag_by_key():
tags = [{'Key': 'foo', 'Value': 'bar'}, {'Key': 'baz', 'Value': 'quux'}]
assert utils.get_tag_b... | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import pytest
from lib import utils
def test_get_tag_by_key():
tags = [{'Key': 'foo', 'Value': 'bar'}, {'Key': 'baz', 'Value': 'quux'}]
assert utils.get_tag_by_key(tags, 'foo') == 'bar'
assert util... | en | 0.655458 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 | 2.273025 | 2 |
scripts/spring 2020/relax results/relax_results_cf_calibration.py | ronan-keane/hav-sim | 0 | 6630559 | <filename>scripts/spring 2020/relax results/relax_results_cf_calibration.py
"""
@author: <EMAIL>
"""
import havsim.calibration.calibration as hc
import time
import scipy.optimize as sc
import matplotlib.pyplot as plt
import math
import pickle
import havsim.calibration.calibration_models as hm
# load data
try:
wit... | <filename>scripts/spring 2020/relax results/relax_results_cf_calibration.py
"""
@author: <EMAIL>
"""
import havsim.calibration.calibration as hc
import time
import scipy.optimize as sc
import matplotlib.pyplot as plt
import math
import pickle
import havsim.calibration.calibration_models as hm
# load data
try:
wit... | en | 0.690544 | @author: <EMAIL> # load data #load data #load data # categorize vehicles # define training loop Runs differential evolution to fit parameters for a list of CalibrationVehicle's #veh_id_list = list of float vehicle id, bounds = bounds for optimizer (list of tuples), #kwargs = dictionary with keyword arguments for hc.mak... | 2.250499 | 2 |
dropzone_backup_server/security.py | nagylzs/dropzone-backup-server | 0 | 6630560 | import time
import os
import re
import warnings
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
from .error import AbortRequest
VALID_PERM_CODES = "W"
HEADER = "# username:upload_dir_prefix:permission_flags:password_hash"
class SecurityManager(object):
"""Manages a list of ... | import time
import os
import re
import warnings
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
from .error import AbortRequest
VALID_PERM_CODES = "W"
HEADER = "# username:upload_dir_prefix:permission_flags:password_hash"
class SecurityManager(object):
"""Manages a list of ... | en | 0.761413 | Manages a list of users. Can only be used from a single thread (async server). DO NOT USE FROM MULTIPLE THREADS OR PROCESSES. You can write into the passwd file on the disk, and it will be reloaded within the number of seconds defined in the TTL value below. Otherwise all updates should be done throu... | 2.875267 | 3 |
MISP/cef_format.py | andradjp/tools | 0 | 6630561 | import datetime, send_data
cefmapping = {"ip-src": "src", "ip-dst": "dst", "hostname": "dhost", "domain": "dhost",
"md5": "fileHash", "sha1": "fileHash", "sha256": "fileHash",
"url": "request"}
mispattributes = {'input': list(cefmapping.keys())}
outputFileExtension = "cef"
responseType = "... | import datetime, send_data
cefmapping = {"ip-src": "src", "ip-dst": "dst", "hostname": "dhost", "domain": "dhost",
"md5": "fileHash", "sha1": "fileHash", "sha256": "fileHash",
"url": "request"}
mispattributes = {'input': list(cefmapping.keys())}
outputFileExtension = "cef"
responseType = "... | none | 1 | 2.322717 | 2 | |
autoload/SimplenoteList.py | Andrea-Augello/simplenote.vim | 208 | 6630562 | def SimplenoteList():
if (float(vim.eval("a:0"))>=1):
try:
# check for valid date string
datetime.datetime.strptime(vim.eval("a:1"), "%Y-%m-%d")
interface.list_note_index_in_scratch_buffer(since=vim.eval("a:1"))
except ValueError:
interface.list_note_i... | def SimplenoteList():
if (float(vim.eval("a:0"))>=1):
try:
# check for valid date string
datetime.datetime.strptime(vim.eval("a:1"), "%Y-%m-%d")
interface.list_note_index_in_scratch_buffer(since=vim.eval("a:1"))
except ValueError:
interface.list_note_i... | en | 0.64254 | # check for valid date string # Note: error has to be caught here and not in __init__ # vim: expandtab | 2.272382 | 2 |
src/openbiolink/graph_creation/metadata_infile/mapping/inMetaMapString.py | jerryhluo/OpenBioLink | 97 | 6630563 | <filename>src/openbiolink/graph_creation/metadata_infile/mapping/inMetaMapString.py
from openbiolink.graph_creation.metadata_infile.infileMetadata import InfileMetadata
from openbiolink.graph_creation.types.infileType import InfileType
from openbiolink.namespace import *
class InMetaMapString(InfileMetadata):
CSV... | <filename>src/openbiolink/graph_creation/metadata_infile/mapping/inMetaMapString.py
from openbiolink.graph_creation.metadata_infile.infileMetadata import InfileMetadata
from openbiolink.graph_creation.types.infileType import InfileType
from openbiolink.namespace import *
class InMetaMapString(InfileMetadata):
CSV... | none | 1 | 2.146186 | 2 | |
substructure.py | egepaksoy/python | 1 | 6630564 | def search(self):
response = []
z = 0
while z < len(self):
if self[z] == ' ':
response.append(self[:z])
self = self[z+1:]
z = 0
if z == len(self)-1:
response.append(self)
break
else:
z += 1
retur... | def search(self):
response = []
z = 0
while z < len(self):
if self[z] == ' ':
response.append(self[:z])
self = self[z+1:]
z = 0
if z == len(self)-1:
response.append(self)
break
else:
z += 1
retur... | en | 0.314001 | # 0 1 2 3 4 5 #! import substructure #! print(substructure.search_algorithm('')) | 3.6102 | 4 |
catch/filter/tests/test_adapter_filter.py | broadinstitute/catch | 58 | 6630565 | """Tests for adapter_filter module.
"""
import logging
import unittest
from catch.filter import adapter_filter as af
from catch.filter import candidate_probes as cp
from catch import genome
from catch import probe
from catch.utils import interval
__author__ = '<NAME> <<EMAIL>>'
class TestAdapterFilter(unittest.Tes... | """Tests for adapter_filter module.
"""
import logging
import unittest
from catch.filter import adapter_filter as af
from catch.filter import candidate_probes as cp
from catch import genome
from catch import probe
from catch.utils import interval
__author__ = '<NAME> <<EMAIL>>'
class TestAdapterFilter(unittest.Tes... | en | 0.880545 | Tests for adapter_filter module. Tests the adapter filter output on contrived input. # Disable logging # Specify default adapter sequences Assert that probe has a particular adapter. Args: probe: probe to check adapter: check if 'probe' has this adapter Returns: whe... | 2.907005 | 3 |
sdc/hiframes/split_impl.py | samir-nasibli/sdc | 0 | 6630566 | # *****************************************************************************
# Copyright (c) 2019, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | # *****************************************************************************
# Copyright (c) 2019, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | en | 0.519849 | # ***************************************************************************** # Copyright (c) 2019, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sou... | 1.510955 | 2 |
explore.py | GouthamShiv/ML-salaryPrediction | 0 | 6630567 | <gh_stars>0
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
# Function to group countries which are having records less than provided cut-off
def shorten_categories(categories, cutoff):
categorical_map = {}
for i in range(len(categories)):
if categories.values[i] >= cutoff:
... | import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
# Function to group countries which are having records less than provided cut-off
def shorten_categories(categories, cutoff):
categorical_map = {}
for i in range(len(categories)):
if categories.values[i] >= cutoff:
c... | en | 0.836853 | # Function to group countries which are having records less than provided cut-off # Function to convert the YearsCode to float value and map # TEXT values ('More than 50 years' & 'Less than 1 year') to float as well # Function to convert the EdLevel to simpler category # Filter to required columns only # Rename the col... | 4.049232 | 4 |
utils/scripts/end2end_iterator_test.py | TeeKay53/Dialogue-systems-for-language-learning | 1 | 6630568 | import os
import tensorflow as tf
from tensorflow.python.ops import lookup_ops
from utils import end2end_iterator_utils
from utils import vocab_utils
def iterator_split():
text_file_path = os.path.abspath("test_file.txt")
dataset = tf.contrib.data.TextLineDataset(text_file_path)
dataset = dataset.map(... | import os
import tensorflow as tf
from tensorflow.python.ops import lookup_ops
from utils import end2end_iterator_utils
from utils import vocab_utils
def iterator_split():
text_file_path = os.path.abspath("test_file.txt")
dataset = tf.contrib.data.TextLineDataset(text_file_path)
dataset = dataset.map(... | en | 0.192425 | # Split into words # dataset = dataset.map(lambda indices, shape, values: (tf.sparse_to_dense(sparse_indices=indices, # output_shape=shape, # sparse_values=values, # ... | 2.683466 | 3 |
Automation/NeonOcean.S4.Order/Mod_NeonOcean_S4_Order/Mod.py | NeonOcean/Order | 0 | 6630569 | <filename>Automation/NeonOcean.S4.Order/Mod_NeonOcean_S4_Order/Mod.py
import os
import typing
from json import decoder
from Mod_NeonOcean_S4_Order import Paths
# noinspection PyTypeChecker
_mod = None # type: Mod
_modData = dict() # type: typing.Dict[str, typing.Any]
class Mod:
def __init__ (self, informationDict... | <filename>Automation/NeonOcean.S4.Order/Mod_NeonOcean_S4_Order/Mod.py
import os
import typing
from json import decoder
from Mod_NeonOcean_S4_Order import Paths
# noinspection PyTypeChecker
_mod = None # type: Mod
_modData = dict() # type: typing.Dict[str, typing.Any]
class Mod:
def __init__ (self, informationDict... | en | 0.288695 | # noinspection PyTypeChecker # type: Mod # type: typing.Dict[str, typing.Any] # type: str # type: str # type: str # type: str # type: str # type: typing.List[Package] # type: str # type: str # type: str # type: str # type: typing.Dict[str, str] # type: str # type: str # type: str # type: str # type: str # type: str # t... | 2.244375 | 2 |
examples/flask_threaded_rpc_client.py | cloudamqp/amqpstorm | 0 | 6630570 | <gh_stars>0
import threading
from time import sleep
from flask import Flask
import amqpstorm
from amqpstorm import Message
app = Flask(__name__)
class RpcClient(object):
"""Asynchronous Rpc client."""
def __init__(self, host, username, password, rpc_queue):
self.queue = {}
self.host = host... | import threading
from time import sleep
from flask import Flask
import amqpstorm
from amqpstorm import Message
app = Flask(__name__)
class RpcClient(object):
"""Asynchronous Rpc client."""
def __init__(self, host, username, password, rpc_queue):
self.queue = {}
self.host = host
sel... | en | 0.837218 | Asynchronous Rpc client. Open Connection. Create a thread responsible for consuming messages in response to RPC requests. Process Data Events using the Process Thread. On Response store the message with the correlation id in a local dictionary. # Create the Message object. # Create an entry in our loc... | 2.911928 | 3 |
csgo_gsi_arduino_lcd/main.py | Darkness4/csgo-gsi-arduino | 5 | 6630571 | # -*- coding: utf-8 -*-
"""
CSGO's informations displayed on an Arduino featuring a bomb timer.
@auteur: tsuriga, Darkness4
"""
import sys
from qtpy.QtWidgets import QApplication
from csgo_gsi_arduino_lcd.ui.csgo_window import CsgoWindow
def main():
global w
app = QApplication(sys.argv)
w = CsgoWindow... | # -*- coding: utf-8 -*-
"""
CSGO's informations displayed on an Arduino featuring a bomb timer.
@auteur: tsuriga, Darkness4
"""
import sys
from qtpy.QtWidgets import QApplication
from csgo_gsi_arduino_lcd.ui.csgo_window import CsgoWindow
def main():
global w
app = QApplication(sys.argv)
w = CsgoWindow... | en | 0.289986 | # -*- coding: utf-8 -*- CSGO's informations displayed on an Arduino featuring a bomb timer. @auteur: tsuriga, Darkness4 | 1.571026 | 2 |
drdown/medicalrecords/urls.py | fga-gpp-mds/2018.1-Cris-Down | 11 | 6630572 | <reponame>fga-gpp-mds/2018.1-Cris-Down<gh_stars>10-100
from django.conf.urls import url
from drdown.medicalrecords.forms.exam_forms import ExamForm
from drdown.medicalrecords.forms.medicalrecords_forms import MedicalRecordForm
from drdown.medicalrecords.forms.static_data_forms import StaticDataForm
from drdown.medicalr... | from django.conf.urls import url
from drdown.medicalrecords.forms.exam_forms import ExamForm
from drdown.medicalrecords.forms.medicalrecords_forms import MedicalRecordForm
from drdown.medicalrecords.forms.static_data_forms import StaticDataForm
from drdown.medicalrecords.forms.medicines_forms import MedicineForm
from d... | none | 1 | 1.865036 | 2 | |
PyMemAPI/schema/schema.py | josephquang97/pymemapi | 1 | 6630573 | from pydantic import BaseModel, HttpUrl
from typing import List
class Category(BaseModel):
name: str
photo: HttpUrl
class Language(BaseModel):
"""Memrise course language."""
id: int
slug: str
name: str
photo: HttpUrl
parent_id: int
index: int
language_code: str
class Cours... | from pydantic import BaseModel, HttpUrl
from typing import List
class Category(BaseModel):
name: str
photo: HttpUrl
class Language(BaseModel):
"""Memrise course language."""
id: int
slug: str
name: str
photo: HttpUrl
parent_id: int
index: int
language_code: str
class Cours... | en | 0.722169 | Memrise course language. Memrise course schema. Learnable is present for vocabulary Level schema List of level schema | 2.707675 | 3 |
20210825.py | alexholft/TIL | 0 | 6630574 | <filename>20210825.py
Today I learned - Database
print('Oracle')
| <filename>20210825.py
Today I learned - Database
print('Oracle')
| none | 1 | 1.02237 | 1 | |
news/news3k.py | lofmat/history_now | 0 | 6630575 | <filename>news/news3k.py
import datetime
import newspaper
from newspaper.article import ArticleException
from newspaper import Config
import logging
from newspaper import Article
# url = 'https://www.berliner-zeitung.de/'
# url_meduza = "https://meduza.io/"
cfg = Config()
cfg.request_timeout = 15
logging.basicConfig... | <filename>news/news3k.py
import datetime
import newspaper
from newspaper.article import ArticleException
from newspaper import Config
import logging
from newspaper import Article
# url = 'https://www.berliner-zeitung.de/'
# url_meduza = "https://meduza.io/"
cfg = Config()
cfg.request_timeout = 15
logging.basicConfig... | en | 0.541841 | # url = 'https://www.berliner-zeitung.de/' # url_meduza = "https://meduza.io/" # SEP = '#' # sep_line = SEP * 30 # class NewspaperData: # def __init__(self, source): # self.source = source # list of tuples # Sometimes publish date is empty # # for art in x.articles: # logging.info(sep_line) # loggi... | 3.002727 | 3 |
ptp/components/publishers/global_variable_publisher.py | aasseman/pytorchpipe | 232 | 6630576 | # -*- coding: utf-8 -*-
#
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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 require... | # -*- coding: utf-8 -*-
#
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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 require... | en | 0.753225 | # -*- coding: utf-8 -*- # # Copyright (C) tkornuta, IBM Corporation 2019 # # 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 require... | 2.517421 | 3 |
minette/datastore/mysqlstores.py | uezo/minette-python | 31 | 6630577 | <reponame>uezo/minette-python
import MySQLdb
from MySQLdb.cursors import DictCursor
from MySQLdb.connections import Connection
from .connectionprovider import ConnectionProvider
from .contextstore import ContextStore
from .userstore import UserStore
from .messagelogstore import MessageLogStore
from .storeset import St... | import MySQLdb
from MySQLdb.cursors import DictCursor
from MySQLdb.connections import Connection
from .connectionprovider import ConnectionProvider
from .contextstore import ContextStore
from .userstore import UserStore
from .messagelogstore import MessageLogStore
from .storeset import StoreSet
class MySQLConnection... | en | 0.50507 | Connection provider for MySQL Attributes ---------- connection_str : str Connection string connection_params : dict Parameters for connection Parameters ---------- connection_str : str Connection string Get connection Returns ------- ... | 2.622166 | 3 |
toolkit/plsa.py | addgene/Research | 7 | 6630578 | import pandas as pd
import os, argparse
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--inputfile',
type=str,
help='File with raw sequencing reads')
parser.add_argument('--column',
... | import pandas as pd
import os, argparse
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--inputfile',
type=str,
help='File with raw sequencing reads')
parser.add_argument('--column',
... | none | 1 | 3.005572 | 3 | |
server.py | JeffreyUrban/pi-relay-controller | 0 | 6630579 | <gh_stars>0
# Raspberry Pi Relay Controller
from __future__ import print_function
import sys
import time
import json
from flask import Flask
from flask import make_response
from flask import render_template
from flask_bootstrap import Bootstrap
from relay_lib import *
from digital_in_lib import *
error_msg = '{msg... | # Raspberry Pi Relay Controller
from __future__ import print_function
import sys
import time
import json
from flask import Flask
from flask import make_response
from flask import render_template
from flask_bootstrap import Bootstrap
from relay_lib import *
from digital_in_lib import *
error_msg = '{msg:"error"}'
s... | en | 0.861314 | # Raspberry Pi Relay Controller # Initialize these from channels.json # initialize the relay library with the system's port configuration # On the Pi, you need to run the app using this command to make sure it # listens for requests outside of the device. | 2.778015 | 3 |
experimental/roofit_expert.py | jjacob/DailyPythonScripts | 0 | 6630580 | from __future__ import division
from optparse import OptionParser
from math import sqrt
import sys
# rootpy ... | from __future__ import division
from optparse import OptionParser
from math import sqrt
import sys
# rootpy ... | en | 0.45467 | # rootpy # copied from 01_get_fit_results.py # summing needed # hot fix for 2011 data. Needs reprocessing for nicer paths # extracting the V+Jets template from its specific b-tag bin (>=0 by default) and scaling it to analysis b-tag bin # data-driven QCD template extracted from all-inclusive eta distributions # scaling... | 2.040224 | 2 |
var/spack/repos/builtin/packages/r-tidyverse/package.py | kkauder/spack | 2 | 6630581 | # Copyright 2013-2021 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)
from spack import *
class RTidyverse(RPackage):
"""Easily Install and Load the 'Tidyverse'
The 'tidyverse' is a... | # Copyright 2013-2021 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)
from spack import *
class RTidyverse(RPackage):
"""Easily Install and Load the 'Tidyverse'
The 'tidyverse' is a... | en | 0.811442 | # Copyright 2013-2021 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) Easily Install and Load the 'Tidyverse' The 'tidyverse' is a set of packages that work in harmony because they sha... | 1.643444 | 2 |
tests/e2e/workloads/couchbase/test_couchbase_pod_respin.py | keemano/ocs-ci | 0 | 6630582 | import logging
import pytest
from ocs_ci.framework.testlib import E2ETest, workloads, ignore_leftovers
from ocs_ci.helpers.disruption_helpers import Disruptions
from ocs_ci.ocs import flowtest
from ocs_ci.helpers.sanity_helpers import Sanity
log = logging.getLogger(__name__)
@workloads
@ignore_leftovers
@pytest.mar... | import logging
import pytest
from ocs_ci.framework.testlib import E2ETest, workloads, ignore_leftovers
from ocs_ci.helpers.disruption_helpers import Disruptions
from ocs_ci.ocs import flowtest
from ocs_ci.helpers.sanity_helpers import Sanity
log = logging.getLogger(__name__)
@workloads
@ignore_leftovers
@pytest.mar... | en | 0.26387 | Deploy an CouchBase workload using operator Creates couchbase workload | 2.061501 | 2 |
external_apps/docutils-snapshot/test/test_readers/test_python/test_token_parser.py | spreeker/democracygame | 2 | 6630583 | <reponame>spreeker/democracygame
#! /usr/bin/env python
# $Id: test_token_parser.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils/readers/python/moduleparser.py.
"""
from __init__ import DocutilsTestSupport
def s... | #! /usr/bin/env python
# $Id: test_token_parser.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils/readers/python/moduleparser.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSuppo... | en | 0.606656 | #! /usr/bin/env python # $Id: test_token_parser.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: <NAME> <<EMAIL>> # Copyright: This module has been placed in the public domain. Tests for docutils/readers/python/moduleparser.py. a = 1 1 a = b = 1 1 \ a = ( 1 + 2 + 3 ) (1 + 2 + 3) \ a = """\\ line one line... | 2.731875 | 3 |
tools/kaldi_to_mace.py | TonyMou/kaldi-onnx | 0 | 6630584 | <reponame>TonyMou/kaldi-onnx
# Copyright 2019 Xiaomi, Inc. 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 ... | # Copyright 2019 Xiaomi, Inc. 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 applicable law or... | en | 0.849856 | # Copyright 2019 Xiaomi, Inc. 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 applicable law or... | 2.412524 | 2 |
frille-lang/lib/python3.6/site-packages/thinc/config.py | frillecode/CDS-spring-2021-language | 10 | 6630585 | from __future__ import unicode_literals
import configparser
import json
from pathlib import Path
class Config(dict):
def __init__(self, data=None):
dict.__init__(self)
if data is None:
data = {}
self.update(data)
def interpret_config(self, config):
for section, va... | from __future__ import unicode_literals
import configparser
import json
from pathlib import Path
class Config(dict):
def __init__(self, data=None):
dict.__init__(self)
if data is None:
data = {}
self.update(data)
def interpret_config(self, config):
for section, va... | none | 1 | 2.83742 | 3 | |
iommi/form.py | tltx/iommi | 0 | 6630586 | import re
import warnings
from contextlib import contextmanager
from datetime import datetime
from decimal import (
Decimal,
InvalidOperation,
)
from functools import reduce
from operator import or_
from typing import (
Any,
Callable,
Dict,
List,
Set,
Tuple,
Type,
Union,
Opti... | import re
import warnings
from contextlib import contextmanager
from datetime import datetime
from decimal import (
Decimal,
InvalidOperation,
)
from functools import reduce
from operator import or_
from typing import (
Any,
Callable,
Dict,
List,
Set,
Tuple,
Type,
Union,
Opti... | en | 0.722794 | # Prevent django templates from calling That Which Must Not Be Called # pragma: no mutate The string is just to make debugging nice # pragma: no mutate The string is just to make debugging nice # two phase save for creation in django, have to save main object before related stuff # two phase save for creation in django... | 1.590903 | 2 |
service_stats/stats/cpu.py | Justintime50/service | 1 | 6630587 | import psutil
class Cpu():
@staticmethod
def serve_data():
"""Serve CPU info
"""
# Title
cpu_title = '='*15 + ' CPU Information ' + '='*15
# Cores
physical_cores = 'Physical cores:' + \
str(psutil.cpu_count(logical=False))
total_cores = 'Tot... | import psutil
class Cpu():
@staticmethod
def serve_data():
"""Serve CPU info
"""
# Title
cpu_title = '='*15 + ' CPU Information ' + '='*15
# Cores
physical_cores = 'Physical cores:' + \
str(psutil.cpu_count(logical=False))
total_cores = 'Tot... | en | 0.695951 | Serve CPU info # Title # Cores # CPU Frequencies # CPU Usage # Combine each core into a variable | 3.064498 | 3 |
mailchimp_marketing_asyncio/models/subscriber_in_automation_queue2.py | john-parton/mailchimp-asyncio | 0 | 6630588 | <filename>mailchimp_marketing_asyncio/models/subscriber_in_automation_queue2.py
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: <EMAIL>
Generated b... | <filename>mailchimp_marketing_asyncio/models/subscriber_in_automation_queue2.py
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: <EMAIL>
Generated b... | en | 0.614132 | # coding: utf-8 Mailchimp Marketing API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 3.0.74 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 NOTE: This class is au... | 1.89453 | 2 |
utils.py | dirtycomputer/Medical-Transformer | 0 | 6630589 | import os
import numpy as np
import torch
from skimage import io,color
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms as T
from torchvision.transforms import functional as F
from typing import Callable
import os
import cv2
import pandas as pd
from numbers import Number
... | import os
import numpy as np
import torch
from skimage import io,color
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms as T
from torchvision.transforms import functional as F
from typing import Callable
import os
import cv2
import pandas as pd
from numbers import Number
... | en | 0.628414 | # handle numpy array # backward compatibility # print(images) Performs augmentation on image and mask when called. Due to the randomness of augmentation transforms, it is not enough to simply apply the same Transform from torchvision on the image and mask separetely. Doing this will result in messing up the gro... | 2.661772 | 3 |
venv/lib/python3.9/site-packages/OpenSSL/_util.py | almmello/frozen | 7 | 6630590 | <gh_stars>1-10
import sys
import warnings
from six import PY2, text_type
from cryptography.hazmat.bindings.openssl.binding import Binding
binding = Binding()
binding.init_static_locks()
ffi = binding.ffi
lib = binding.lib
# This is a special CFFI allocator that does not bother to zero its memory
# after allocatio... | import sys
import warnings
from six import PY2, text_type
from cryptography.hazmat.bindings.openssl.binding import Binding
binding = Binding()
binding.init_static_locks()
ffi = binding.ffi
lib = binding.lib
# This is a special CFFI allocator that does not bother to zero its memory
# after allocation. This has vas... | en | 0.745919 | # This is a special CFFI allocator that does not bother to zero its memory # after allocation. This has vastly better performance on large allocations and # so should be used whenever we don't need the memory zeroed out. Get a native string type representing of the given CFFI ``char*`` object. :param charp: A C-st... | 2.417528 | 2 |
random_tool/random_genetate.py | stwrd/ImageProcessTool | 0 | 6630591 | <filename>random_tool/random_genetate.py<gh_stars>0
import numpy as np
p = 0.8
sample_num = 10000
sample = np.random.random_sample(sample_num)
sample[sample>p] = 1
sample[sample<=p] = 0
print('sample ',sample.sum())
select = np.random.randint(0,2,sample_num)
print('select ',select.sum())
mask = (sample==select)
prin... | <filename>random_tool/random_genetate.py<gh_stars>0
import numpy as np
p = 0.8
sample_num = 10000
sample = np.random.random_sample(sample_num)
sample[sample>p] = 1
sample[sample<=p] = 0
print('sample ',sample.sum())
select = np.random.randint(0,2,sample_num)
print('select ',select.sum())
mask = (sample==select)
prin... | none | 1 | 2.851379 | 3 | |
app/documents/migrations/0012_auto_20201022_0110.py | roxtrom13/real-back | 0 | 6630592 | # Generated by Django 3.1.2 on 2020-10-22 01:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0011_auto_20201022_0029'),
]
operations = [
migrations.AlterField(
model_name='document',
name='author'... | # Generated by Django 3.1.2 on 2020-10-22 01:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0011_auto_20201022_0029'),
]
operations = [
migrations.AlterField(
model_name='document',
name='author'... | en | 0.845332 | # Generated by Django 3.1.2 on 2020-10-22 01:10 | 1.588606 | 2 |
source/campo/op_experimental/network.py | Shellydun/campo | 2 | 6630593 | import copy
import numpy
import networkx as nx
from ..values import Values
def neighbour_network(nodes, neighbours, probability, seed=None):
G = nx.watts_strogatz_graph(n=nodes, k=neighbours, p=probability, seed=seed)
a = nx.to_numpy_array(G, dtype=numpy.int8)
# To avoid that location 0 always corre... | import copy
import numpy
import networkx as nx
from ..values import Values
def neighbour_network(nodes, neighbours, probability, seed=None):
G = nx.watts_strogatz_graph(n=nodes, k=neighbours, p=probability, seed=seed)
a = nx.to_numpy_array(G, dtype=numpy.int8)
# To avoid that location 0 always corre... | en | 0.766993 | # To avoid that location 0 always corresponds to node 0 we shuffle the nework # this may lead to locations pointing at themselves?! #numpy.random.shuffle(a) #nval = value_prop.values.values[n] | 2.447237 | 2 |
app.py | adulting-dev/adulting.dev | 5 | 6630594 | from flask import Flask, render_template
from flaskext.markdown import Markdown
import contentful
from rich_text_renderer import RichTextRenderer
from rich_text_renderer.base_node_renderer import BaseNodeRenderer
from rich_text_renderer.null_renderer import NullRenderer
import os
from dotenv import load_dotenv
load_do... | from flask import Flask, render_template
from flaskext.markdown import Markdown
import contentful
from rich_text_renderer import RichTextRenderer
from rich_text_renderer.base_node_renderer import BaseNodeRenderer
from rich_text_renderer.null_renderer import NullRenderer
import os
from dotenv import load_dotenv
load_do... | none | 1 | 2.348178 | 2 | |
Models/Model 1/Additional Hyperparameter Tuning Scripts/pretrained_point001_point4.py | ChaojieZhang-cz/DL-Project-Brain-MRI-and-Personality-Type | 1 | 6630595 | import os
import yaml
import torch
import nibabel as nib
import numpy as np
import pandas as pd
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import time
import pickle
from torch.utils.data import Dataset, DataLoader
from torch.optim.lr_scheduler import LambdaLR,MultiStepLR
import matplo... | import os
import yaml
import torch
import nibabel as nib
import numpy as np
import pandas as pd
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import time
import pickle
from torch.utils.data import Dataset, DataLoader
from torch.optim.lr_scheduler import LambdaLR,MultiStepLR
import matplo... | en | 0.566351 | # build model from Liu et al.'s github code # for untrained use: #config_name = './CNN_design_for_AD-master/config.yaml' # pretrained model #Normalization #label = self.df.loc[idx][['N','E','O','A','C']].values.astype(int) # predict C # full dataset # for debugging and to see if model can learn training set on tiny sam... | 2.081497 | 2 |
srt.py | KonstT-math/response-time | 0 | 6630596 |
# How to use:
#
# download psychopy for it is required
#
# In the "initialization section":
# 1) Input a sequence which represents the stimulus position as follows: observables=[3,1,2,0,1]
# 2) Set the file path to print output: f=open(r"path\to\file.txt", "w")
# 3) Set the file path for the image stimulus: the_image=... |
# How to use:
#
# download psychopy for it is required
#
# In the "initialization section":
# 1) Input a sequence which represents the stimulus position as follows: observables=[3,1,2,0,1]
# 2) Set the file path to print output: f=open(r"path\to\file.txt", "w")
# 3) Set the file path for the image stimulus: the_image=... | en | 0.772417 | # How to use: # # download psychopy for it is required # # In the "initialization section": # 1) Input a sequence which represents the stimulus position as follows: observables=[3,1,2,0,1] # 2) Set the file path to print output: f=open(r"path\to\file.txt", "w") # 3) Set the file path for the image stimulus: the_image=r... | 3.784015 | 4 |
physics.py | greendragon1985/Minecraft | 4 | 6630597 | <filename>physics.py
# Imports, sorted alphabetically.
# Python packages
# Nothing for now...
# Third-party packages
# Nothing for now...
# Modules from this project
# Nothing for now...
from timer import Timer
__all__ = (
'PhysicsTask', 'PhysicsManager', 'physics_manager',
)
PHYSICS_TIMER_INTERVAL = PHYSICS_T... | <filename>physics.py
# Imports, sorted alphabetically.
# Python packages
# Nothing for now...
# Third-party packages
# Nothing for now...
# Modules from this project
# Nothing for now...
from timer import Timer
__all__ = (
'PhysicsTask', 'PhysicsManager', 'physics_manager',
)
PHYSICS_TIMER_INTERVAL = PHYSICS_T... | en | 0.791093 | # Imports, sorted alphabetically. # Python packages # Nothing for now... # Third-party packages # Nothing for now... # Modules from this project # Nothing for now... # do physics to an object which has: # * method update_position(position) to update its position | 3.025779 | 3 |
cmdb_v0.1/manage.py | codemaker-man/projects | 1 | 6630598 | <gh_stars>1-10
#!/usr/bin/env python
#为了区分线上和测试等不同的配置文件,修改mange.py
# 制定配置文件:
# python manage.py runserver --settings=admin.settings.local_cj
import os
import sys
if __name__ == "__main__":
print(111111, sys.argv)
if len(sys.argv) > 3:
print(222222)
run_arg = sys.argv[2]
if not run_arg... | #!/usr/bin/env python
#为了区分线上和测试等不同的配置文件,修改mange.py
# 制定配置文件:
# python manage.py runserver --settings=admin.settings.local_cj
import os
import sys
if __name__ == "__main__":
print(111111, sys.argv)
if len(sys.argv) > 3:
print(222222)
run_arg = sys.argv[2]
if not run_arg.startswith('--... | en | 0.485571 | #!/usr/bin/env python #为了区分线上和测试等不同的配置文件,修改mange.py # 制定配置文件: # python manage.py runserver --settings=admin.settings.local_cj # print(11111, sys.argv) # if len(sys.argv) > 2 and sys.argv[2].startswith('--settings'): # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "admin.settings.local_cj") # else: # os.enviro... | 2.507325 | 3 |
c2t.py | ameent/c2t | 3 | 6630599 | <gh_stars>1-10
__author__ = '<NAME>'
from translator import *
# Ask for user input
output_file_name = raw_input("Enter name of output file (e.g. ammo.d.ts): ")
header_folder = raw_input("Enter top level folder location of header files: ")
module_name = raw_input("Enter a name for top level module for generated classe... | __author__ = '<NAME>'
from translator import *
# Ask for user input
output_file_name = raw_input("Enter name of output file (e.g. ammo.d.ts): ")
header_folder = raw_input("Enter top level folder location of header files: ")
module_name = raw_input("Enter a name for top level module for generated classes: ")
excluded_... | en | 0.662696 | # Ask for user input # Create a translator class to perform the actual parsing | 2.990953 | 3 |
lib/membase/api/esrest_client.py | ramalingam-cb/testrunner | 0 | 6630600 | <filename>lib/membase/api/esrest_client.py
from membase.api.rest_client import RestConnection, Bucket, BucketStats, OtpNode, Node
from remote.remote_util import RemoteMachineShellConnection
from TestInput import TestInputSingleton
from pyes import ES, managers, query
import logger
import time
import requests
log = lo... | <filename>lib/membase/api/esrest_client.py
from membase.api.rest_client import RestConnection, Bucket, BucketStats, OtpNode, Node
from remote.remote_util import RemoteMachineShellConnection
from TestInput import TestInputSingleton
from pyes import ES, managers, query
import logger
import time
import requests
log = lo... | en | 0.767089 | # EsRestConnection: subclasses RestConnection for use against elastic-search nodes. # Instance created by membase.api.rest_client.RestConnection # when elastic-search endpoint is detected so it is not necessary to # directly import this module into tests #serverInfo can be a json object #only connect pyes to mast... | 2.301711 | 2 |
appengine/findit/libs/gitiles/test/commit_util_test.py | mcgreevy/chromium-infra | 1 | 6630601 | <filename>appengine/findit/libs/gitiles/test/commit_util_test.py
# Copyright 2014 The Chromium 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 json
import StringIO
from testing_utils import testing
import textwrap
import urllib2... | <filename>appengine/findit/libs/gitiles/test/commit_util_test.py
# Copyright 2014 The Chromium 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 json
import StringIO
from testing_utils import testing
import textwrap
import urllib2... | en | 0.690358 | # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. #390254}\n', #293661}', #289120}', #456563}', #341992}\n\n' #342013}\n') #326953}\n>\n' #327021}\n\n' #332062}\n') #332062}\n') | 2.045183 | 2 |
python/SquareEveryDigit/setup.py | dheraclio/codewars | 0 | 6630602 | <filename>python/SquareEveryDigit/setup.py
from setuptools import setup, find_packages
setup (
name='SquareEveryDigit',
version='0.1',
packages=find_packages(),
# Declare your packages' dependencies here, for eg:
install_requires=['foo>=3'],
# Fill in these to make your Egg ... | <filename>python/SquareEveryDigit/setup.py
from setuptools import setup, find_packages
setup (
name='SquareEveryDigit',
version='0.1',
packages=find_packages(),
# Declare your packages' dependencies here, for eg:
install_requires=['foo>=3'],
# Fill in these to make your Egg ... | en | 0.893719 | # Declare your packages' dependencies here, for eg: # Fill in these to make your Egg ready for upload to # PyPI #summary = 'Just another Python package for the cheese shop', # could also include long_description, download_url, classifiers, etc. | 1.996122 | 2 |
boa/code/line.py | chisleu/neo-boa | 2 | 6630603 | from byteplay3 import *
from boa.code import pyop
class Line():
"""
"""
items = None
def __init__(self, item_list):
self.items = item_list
@property
def is_import(self):
"""
:return:
"""
for i, (op, arg) in enumerate(self.items):
if op ... | from byteplay3 import *
from boa.code import pyop
class Line():
"""
"""
items = None
def __init__(self, item_list):
self.items = item_list
@property
def is_import(self):
"""
:return:
"""
for i, (op, arg) in enumerate(self.items):
if op ... | en | 0.302012 | :return: :return: # return False returns whether a line is a docstring :return: whether a line is a documentation string :rtype: bool :return: :return: :return: :return: :return: | 2.63847 | 3 |
tests/test_rnmrtk.py | tjragan/nmrglue | 1 | 6630604 | <filename>tests/test_rnmrtk.py
""" Tests for the fileio.rnmrtk submodule """
import tempfile
import os
from numpy.testing import assert_array_equal
import nmrglue as ng
from nose.plugins.attrib import attr
from setup import DATA_DIR
# subroutines
def write_readback(dic, data):
""" write out and readback a RNMRT... | <filename>tests/test_rnmrtk.py
""" Tests for the fileio.rnmrtk submodule """
import tempfile
import os
from numpy.testing import assert_array_equal
import nmrglue as ng
from nose.plugins.attrib import attr
from setup import DATA_DIR
# subroutines
def write_readback(dic, data):
""" write out and readback a RNMRT... | en | 0.751934 | Tests for the fileio.rnmrtk submodule # subroutines write out and readback a RNMRTK file. lowmemory write out and readback a RNMTRK file. # check value [0,1,...] # tests reading/writing of 1D RNMRTK time domain file reading/writing of 1D RNMRTK frequency domain file reading/writing of 2D RNMRTK time domain file reading... | 2.339817 | 2 |
setup.py | IBM/pyds8k | 7 | 6630605 | <gh_stars>1-10
##############################################################################
# Copyright 2019 IBM Corp.
#
# 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.... | ##############################################################################
# Copyright 2019 IBM Corp.
#
# 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/LI... | en | 0.600794 | ############################################################################## # Copyright 2019 IBM Corp. # # 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/LI... | 1.61164 | 2 |
bin/arguments.py | christine-liu/somaticCNVpipeline | 0 | 6630606 | <filename>bin/arguments.py
#!/usr/bin/python
import argparse
###basic parser for parent help statement###
def parentArgs():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Suzanne's pipeline to identify somatic CNVs from single-cell whole-genome seq... | <filename>bin/arguments.py
#!/usr/bin/python
import argparse
###basic parser for parent help statement###
def parentArgs():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Suzanne's pipeline to identify somatic CNVs from single-cell whole-genome seq... | en | 0.478148 | #!/usr/bin/python ###basic parser for parent help statement### \ Suzanne's pipeline to identify somatic CNVs from single-cell whole-genome sequencing data ========================================================================================= You must specify a function to perform: *preprocess (trim fastq read... | 2.651022 | 3 |
tools/constants_generator.py | kylekrol/psim | 5 | 6630607 | import csv
CSV_FILE='tools/constants.csv'
HPP_FILE='include/gnc/constants.hpp'
HPP_HEADER='''\
/** @file gnc/constants.hpp
* Autocoded constants header file. See tools/constants_generator.py for more
* information. */
#ifndef GNC_CONSTANTS_HPP_
#define GNC_CONSTANTS_HPP_
#include "config.hpp"
#include <lin/cor... | import csv
CSV_FILE='tools/constants.csv'
HPP_FILE='include/gnc/constants.hpp'
HPP_HEADER='''\
/** @file gnc/constants.hpp
* Autocoded constants header file. See tools/constants_generator.py for more
* information. */
#ifndef GNC_CONSTANTS_HPP_
#define GNC_CONSTANTS_HPP_
#include "config.hpp"
#include <lin/cor... | en | 0.478788 | \ /** @file gnc/constants.hpp * Autocoded constants header file. See tools/constants_generator.py for more * information. */ #ifndef GNC_CONSTANTS_HPP_ #define GNC_CONSTANTS_HPP_ #include "config.hpp" #include <lin/core.hpp> #include <cstdint> #include <limits> namespace gnc { namespace constant { \ } // nam... | 2.198911 | 2 |
data_collect_process/history_weather_collect.py | BigBigRadish/JX_MATH_Model_b | 2 | 6630608 | <reponame>BigBigRadish/JX_MATH_Model_b
#!/home/admin/anaconda3/envs/TF/bin/ python3.5
# -*- coding: utf-8 -*-
'''
Created on 2018年6月9日
@author: <NAME>
Jiangxi university of finance and economics
'''
from bs4 import BeautifulSoup
import re
import requests
from pymongo import MongoClient
citylist=['anqing',... | #!/home/admin/anaconda3/envs/TF/bin/ python3.5
# -*- coding: utf-8 -*-
'''
Created on 2018年6月9日
@author: <NAME>
Jiangxi university of finance and economics
'''
from bs4 import BeautifulSoup
import re
import requests
from pymongo import MongoClient
citylist=['anqing','baotou','changsha','changzhou','chaoya... | en | 0.279244 | #!/home/admin/anaconda3/envs/TF/bin/ python3.5 # -*- coding: utf-8 -*- Created on 2018年6月9日
@author: <NAME>
Jiangxi university of finance and economics #html.parser #print (soup) #日期 #天气状况 # #collection.insert(weatherDetails) # for idx, tr in enumerate(soup.find_all('tr')): # if idx != 0: # ... | 2.424087 | 2 |
9term/fipt/P2PLending/users/forms.py | nik-sergeson/bsuir-informatics-labs | 0 | 6630609 | <reponame>nik-sergeson/bsuir-informatics-labs<gh_stars>0
from django import forms
from django.contrib.auth import get_user_model
from P2PLending.users.models import User, UserMoney
from registration.forms import RegistrationForm
class UserRegistrationForm(RegistrationForm):
first_name = forms.CharField()
last... | from django import forms
from django.contrib.auth import get_user_model
from P2PLending.users.models import User, UserMoney
from registration.forms import RegistrationForm
class UserRegistrationForm(RegistrationForm):
first_name = forms.CharField()
last_name = forms.CharField()
patronymic = forms.CharFiel... | none | 1 | 2.546466 | 3 | |
legacy/flexibility_model/model_building/building_process_hvac_efficiencies.py | AlexJew/CityEnergyAnalyst | 0 | 6630610 | <reponame>AlexJew/CityEnergyAnalyst
"""
MIT License
Copyright (c) 2019 TUMCREATE <https://tum-create.edu.sg/>
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 withou... | """
MIT License
Copyright (c) 2019 TUMCREATE <https://tum-create.edu.sg/>
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... | en | 0.771344 | MIT License Copyright (c) 2019 TUMCREATE <https://tum-create.edu.sg/> 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, mo... | 1.844395 | 2 |
python/test/extra/noref_feature_extractor_extratest.py | elam03/vmaf | 1 | 6630611 | <filename>python/test/extra/noref_feature_extractor_extratest.py
import unittest
from vmaf.config import VmafConfig, VmafExternalConfig
from vmaf.core.asset import NorefAsset
from vmaf.core.noref_feature_extractor import MomentNorefFeatureExtractor
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "A... | <filename>python/test/extra/noref_feature_extractor_extratest.py
import unittest
from vmaf.config import VmafConfig, VmafExternalConfig
from vmaf.core.asset import NorefAsset
from vmaf.core.noref_feature_extractor import MomentNorefFeatureExtractor
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "A... | en | 0.219277 | # @unittest.skipIf(not VmafExternalConfig.ffmpeg_path(), "ffmpeg not installed") | 2.058069 | 2 |
aiomessaging/consumers/message.py | aiomessaging/aiomessaging | 4 | 6630612 | """Message consumer.
"""
from typing import Callable
from ..message import Message
from ..router import Router
from ..queues import AbstractQueue
from ..actions import SendOutputAction, CheckOutputAction
from .base import BaseMessageConsumer
class OutputNotAvailable(Exception):
"""Output not available exception... | """Message consumer.
"""
from typing import Callable
from ..message import Message
from ..router import Router
from ..queues import AbstractQueue
from ..actions import SendOutputAction, CheckOutputAction
from .base import BaseMessageConsumer
class OutputNotAvailable(Exception):
"""Output not available exception... | en | 0.678278 | Message consumer. Output not available exception. Raised if output returned from pipeline is not available (no consumers for such routing key, message will not be delivered). Message consumer. Consume messages from `messages.<event_type>` queue and route it to the next output(s). Output queue use... | 2.389974 | 2 |
splparser/rules/mvexpandrules.py | lowell80/splparser | 31 | 6630613 | <reponame>lowell80/splparser
#!/usr/bin/env python
from splparser.parsetree import *
from splparser.rules.common.fieldrules import *
from splparser.rules.common.fieldlistrules import *
from splparser.rules.common.valuerules import *
from splparser.lexers.mvexpandlexer import tokens
from splparser.exceptions import S... | #!/usr/bin/env python
from splparser.parsetree import *
from splparser.rules.common.fieldrules import *
from splparser.rules.common.fieldlistrules import *
from splparser.rules.common.valuerules import *
from splparser.lexers.mvexpandlexer import tokens
from splparser.exceptions import SPLSyntaxError
start = 'cmdex... | en | 0.270871 | #!/usr/bin/env python cmdexpr : mvexpandcmd mvexpandcmd : MVEXPAND field mvexpandcmd : MVEXPAND field m_limit mvexpandcmd : MVEXPAND m_limit field m_limit : LIMIT EQ value | 2.203795 | 2 |
OOP Ex.py | MoomenEltelbany/PythonDesafios | 0 | 6630614 | from random import randint
tries = 0
comp = randint(0, 100)
print('You have 7 Tries....')
while tries <= 7:
num = int(input('Choose a number: '))
if num > comp:
print(f'You need to choose a smaller number.')
tries += 1
elif num < comp:
print('You need to choose a bigger number.')
... | from random import randint
tries = 0
comp = randint(0, 100)
print('You have 7 Tries....')
while tries <= 7:
num = int(input('Choose a number: '))
if num > comp:
print(f'You need to choose a smaller number.')
tries += 1
elif num < comp:
print('You need to choose a bigger number.')
... | none | 1 | 3.94544 | 4 | |
fomo_social_harvester/scraper/utils.py | dgnsrekt/fomo-social-harvester | 0 | 6630615 | <gh_stars>0
from datetime import datetime, timedelta
import functools
from time import time
from lxml.etree import ParserError, XMLSyntaxError
from requests.exceptions import (SSLError, ReadTimeout, ConnectTimeout,
ConnectionError, ChunkedEncodingError, TooManyRedirects)
def scraper... | from datetime import datetime, timedelta
import functools
from time import time
from lxml.etree import ParserError, XMLSyntaxError
from requests.exceptions import (SSLError, ReadTimeout, ConnectTimeout,
ConnectionError, ChunkedEncodingError, TooManyRedirects)
def scraper_exception_ha... | en | 0.660798 | A decorator that wraps the passed in function and logs exceptions should one occur @param logger: The logging object # TODO: add differen output for RTO, CTO, CE, CHE, UNI, VAL Checks link to see if its a real telegram link. :param str link: :return True if valid telegram link: :rtype: bool Checks... | 2.954597 | 3 |
model.py | fangchenplus/CarND-Behavioral-Cloning-P3 | 0 | 6630616 | <filename>model.py
import csv
import cv2
import numpy as np
from scipy import ndimage
# import matplotlib.pyplot as plt
lines = []
with open('./data/driving_log.csv') as csvfile:
# with open('D:/data/data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)... | <filename>model.py
import csv
import cv2
import numpy as np
from scipy import ndimage
# import matplotlib.pyplot as plt
lines = []
with open('./data/driving_log.csv') as csvfile:
# with open('D:/data/data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)... | en | 0.370792 | # import matplotlib.pyplot as plt # with open('D:/data/data/driving_log.csv') as csvfile: # print(type(lines)) # print(lines[0]) # print(lines[1]) # current_path = 'D:/data/data/IMG/' + filename # image = cv2.imread(current_path) # cv2.imread will get images in BGR format, while drive.py uses RGB # dat... | 2.969132 | 3 |
test/utils/test_negative_sampling.py | snubeaver/pytorch_geometric | 2 | 6630617 | import torch
from torch_geometric.utils import (negative_sampling,
structured_negative_sampling,
batched_negative_sampling)
def test_negative_sampling():
edge_index = torch.as_tensor([[0, 0, 1, 2], [0, 1, 2, 3]])
neg_edge_index = negative_... | import torch
from torch_geometric.utils import (negative_sampling,
structured_negative_sampling,
batched_negative_sampling)
def test_negative_sampling():
edge_index = torch.as_tensor([[0, 0, 1, 2], [0, 1, 2, 3]])
neg_edge_index = negative_... | none | 1 | 2.437235 | 2 | |
mxfusion/components/distributions/gp/kernels/linear.py | JeremiasKnoblauch/MXFusion | 2 | 6630618 | <reponame>JeremiasKnoblauch/MXFusion
# Copyright 2018 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://www.apache.or... | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | en | 0.670554 | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # # or in th... | 2.380876 | 2 |
tartiflette/types/object.py | mazzi/tartiflette | 530 | 6630619 | from functools import partial
from typing import Any, Callable, Dict, List, Optional
from tartiflette.coercers.outputs.directives_coercer import (
output_directives_coercer,
)
from tartiflette.coercers.outputs.object_coercer import object_coercer
from tartiflette.types.helpers.get_directive_instances import (
... | from functools import partial
from typing import Any, Callable, Dict, List, Optional
from tartiflette.coercers.outputs.directives_coercer import (
output_directives_coercer,
)
from tartiflette.coercers.outputs.object_coercer import object_coercer
from tartiflette.types.helpers.get_directive_instances import (
... | en | 0.675079 | Definition of a GraphQL object. # Introspection attributes :param name: name of the object :param fields: map of fields linked to the object :param interfaces: list of interface names implemented by the object :param description: description of the object :param directives: list of direc... | 2.017289 | 2 |
nova/objects/instance_group.py | WeifanFu-bsn/nova | 0 | 6630620 | # Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | # Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | en | 0.837699 | # Copyright (c) 2013 OpenStack Foundation # # 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 ... | 1.886537 | 2 |
LogisticRegression.py | mccannj9/TensorFlowML | 0 | 6630621 | #! /usr/bin/env python
import numpy as np
def tensorflow_solution_gradient_descent(Xdata, ydata, diff="automatic"):
import tensorflow as tf
# half examples for training
Xt, yt = Xdata[::2], ydata[::2]
# Xt, yt = Xdata, ydata
# half examples for validation
Xv, yv = Xdata[1::2], ydata[1::2]
... | #! /usr/bin/env python
import numpy as np
def tensorflow_solution_gradient_descent(Xdata, ydata, diff="automatic"):
import tensorflow as tf
# half examples for training
Xt, yt = Xdata[::2], ydata[::2]
# Xt, yt = Xdata, ydata
# half examples for validation
Xv, yv = Xdata[1::2], ydata[1::2]
... | en | 0.672082 | #! /usr/bin/env python # half examples for training # Xt, yt = Xdata, ydata # half examples for validation # print(Xt) # cost = tf.reduce_mean(tf.log(1+tf.exp(-y*predictions))) # automatic differentiation # print(cgrad) # features_path = data_dir + "Xtrain.txt" # # tf_gradient_wvector = tensorflow_solution_gradient_des... | 3.121828 | 3 |
src/tumcsbot/plugins/sql.py | jpbernius/tumcsbot | 5 | 6630622 | <gh_stars>1-10
#!/usr/bin/env python3
# See LICENSE file for copyright and license details.
# TUM CS Bot - https://github.com/ro-i/tumcsbot
from inspect import cleandoc
from typing import Any, Dict, Iterable, List, Tuple, Union
from tumcsbot.lib import DB, Response
from tumcsbot.plugin import CommandPlugin, PluginCo... | #!/usr/bin/env python3
# See LICENSE file for copyright and license details.
# TUM CS Bot - https://github.com/ro-i/tumcsbot
from inspect import cleandoc
from typing import Any, Dict, Iterable, List, Tuple, Union
from tumcsbot.lib import DB, Response
from tumcsbot.plugin import CommandPlugin, PluginContext
class S... | en | 0.559838 | #!/usr/bin/env python3 # See LICENSE file for copyright and license details. # TUM CS Bot - https://github.com/ro-i/tumcsbot sql <sql_script> or sql list Access the internal database of the bot read-only. The `list` command is a shortcut to list all tables. [administrator/moderator rights need... | 2.310106 | 2 |
music_review/graphql/performer/schema.py | wmalarski/music-reviews | 0 | 6630623 | <gh_stars>0
import graphene
from graphene_django.filter import DjangoFilterConnectionField
from .filters import PerformerFilter
from .mutations import CreatePerformer, UpdatePerformer, DeletePerformer
from .types import PerformerType
class PerformerMutations(graphene.ObjectType):
create_performer = CreatePerform... | import graphene
from graphene_django.filter import DjangoFilterConnectionField
from .filters import PerformerFilter
from .mutations import CreatePerformer, UpdatePerformer, DeletePerformer
from .types import PerformerType
class PerformerMutations(graphene.ObjectType):
create_performer = CreatePerformer.Field()
... | none | 1 | 1.905415 | 2 | |
ctm_api_client/models/certificate_signing_request_data.py | tadinve/ctm_python_client | 0 | 6630624 | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ctm_api_client.configuratio... | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ctm_api_client.configuratio... | en | 0.50604 | # coding: utf-8 Control-M Services Provides access to BMC Control-M Services # noqa: E501 OpenAPI spec version: 9.20.215 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 NOTE: This class is auto generated by the swagger code generator program. Do not... | 1.526769 | 2 |
Taschenrechner.py | Tasm-Devil/Taschenrechner | 1 | 6630625 | <reponame>Tasm-Devil/Taschenrechner
# The MIT License (MIT)
#
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# 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 li... | # The MIT License (MIT)
#
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# 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, ... | en | 0.468926 | # The MIT License (MIT) # # Copyright (c) 2018 <NAME> <<EMAIL>> # # 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.674703 | 2 |
main.py | Raddmason99/EconomyDiscord-Bot | 22 | 6630626 | <gh_stars>10-100
'''
_____ ____ ___ ____ ___ _____ ____
| ____/ ___/ _ \| __ ) / _ \_ _|_ _|___ \
| _|| | | | | | _ \| | | || | \ \ / / __) |
| |__| |__| |_| | |_) | |_| || | \ V / / __/
|_____\____\___/|____/ \___/ |_| \_/ |_____|
- A new feature... | '''
_____ ____ ___ ____ ___ _____ ____
| ____/ ___/ _ \| __ ) / _ \_ _|_ _|___ \
| _|| | | | | | _ \| | | || | \ \ / / __) |
| |__| |__| |_| | |_) | |_| || | \ V / / __/
|_____\____\___/|____/ \___/ |_| \_/ |_____|
- A new feature packet discord e... | en | 0.647907 | _____ ____ ___ ____ ___ _____ ____
| ____/ ___/ _ \| __ ) / _ \_ _|_ _|___ \
| _|| | | | | | _ \| | | || | \ \ / / __) |
| |__| |__| |_| | |_) | |_| || | \ V / / __/
|_____\____\___/|____/ \___/ |_| \_/ |_____|
- A new feature packet discord economy bot.
... | 2.514262 | 3 |
src/data/character.py | SvenElyes/Textanalytics | 1 | 6630627 | from src.data.relation import Relation
class Character:
"""Simple class to store and retrieve information about a character. Specifially: name, aliases for the name, relations to other characters, keywords."""
def __init__(self, name):
self.name = name
self.alias = list()
self.relatio... | from src.data.relation import Relation
class Character:
"""Simple class to store and retrieve information about a character. Specifially: name, aliases for the name, relations to other characters, keywords."""
def __init__(self, name):
self.name = name
self.alias = list()
self.relatio... | en | 0.821823 | Simple class to store and retrieve information about a character. Specifially: name, aliases for the name, relations to other characters, keywords. erases existing wordlist and sets wordlist | 3.861125 | 4 |
reporting_api/tests/test_utils.py | SmartElect/SmartElect | 23 | 6630628 | # Python imports
import datetime
# 3rd party imports
from django.test import TestCase
from django.utils.timezone import now
# Project imports
from register.tests.test_models import RegistrationCenterFactory
from reporting_api.data_pull_common import get_active_registration_locations, \
get_all_polling_locations
f... | # Python imports
import datetime
# 3rd party imports
from django.test import TestCase
from django.utils.timezone import now
# Project imports
from register.tests.test_models import RegistrationCenterFactory
from reporting_api.data_pull_common import get_active_registration_locations, \
get_all_polling_locations
f... | en | 0.880759 | # Python imports # 3rd party imports # Project imports # since there's just one date provided, yesterday can only # be that date regardless of other factors # try again, providing the date object # try again, providing the date objects | 2.382315 | 2 |
rental_state/models.py | lisboalien/api_rental_state_management | 0 | 6630629 | from django.db import models
class RentalStateProperty(models.Model):
RENTAL_STATE_TYPE = (
('C', 'COMERCIAL'),
('R', 'RESIDENCIAL')
)
TYPE = (
('AP', 'APARTAMENTO'),
('CA', 'CASA'),
('CC', 'CASA DE CONDOMÍNIO'),
('CO', 'COBERTURA'),
('FL', 'FLAT'),... | from django.db import models
class RentalStateProperty(models.Model):
RENTAL_STATE_TYPE = (
('C', 'COMERCIAL'),
('R', 'RESIDENCIAL')
)
TYPE = (
('AP', 'APARTAMENTO'),
('CA', 'CASA'),
('CC', 'CASA DE CONDOMÍNIO'),
('CO', 'COBERTURA'),
('FL', 'FLAT'),... | none | 1 | 2.091222 | 2 | |
parakeet/exps/voice_cloning/tacotron2_ge2e/extract_mel.py | zh794390558/DeepSpeech | 0 | 6630630 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | en | 0.856067 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.806366 | 2 |
fakeGen/train.py | bigheiniu/FakeReviewAll | 0 | 6630631 | import torch
import torch.nn as nn
from fakeGen.Discriminator import Discriminator, RNNclaissfier
from fakeGen.seq2seq import Seq2seq
from fakeGen.Generator import Generator
from fakeGen.evaluate import f1_score, accuracy_score, tensor2list
from SeqModel.trainer import SupervisedTrainer
from SeqModel.models import En... | import torch
import torch.nn as nn
from fakeGen.Discriminator import Discriminator, RNNclaissfier
from fakeGen.seq2seq import Seq2seq
from fakeGen.Generator import Generator
from fakeGen.evaluate import f1_score, accuracy_score, tensor2list
from SeqModel.trainer import SupervisedTrainer
from SeqModel.models import En... | en | 0.287937 | # train # clf the simulate text and fake text # classify the hidden state # train the classifier # return discriminator #TODO: print total loss # pad one # shape = torch.Size((opt.batch_size, opt.z_size)) # sim_seq: distribution of words # feature and label will be shuffle in clf # # print the loss and F1 score # gener... | 1.963654 | 2 |
hub/migrations/0002_auto_20210216_0854.py | LindaOuer/django3.1_InnovationHub | 0 | 6630632 | # Generated by Django 3.1.6 on 2021-02-16 07:54
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
import hub.models
class Migration(migrations.Migration):
dependencies = [
('hub', '0001_initial'),
]
operations = [
migrations.AlterModelOp... | # Generated by Django 3.1.6 on 2021-02-16 07:54
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
import hub.models
class Migration(migrations.Migration):
dependencies = [
('hub', '0001_initial'),
]
operations = [
migrations.AlterModelOp... | en | 0.791602 | # Generated by Django 3.1.6 on 2021-02-16 07:54 | 1.854147 | 2 |
drf_util/views.py | RodiZaharadji/drf-util-1 | 0 | 6630633 | <filename>drf_util/views.py
from django.db.models import QuerySet
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import mixins, status
from rest_framework.decorators import permission_classes, api_view
from rest_framework.permissions import AllowAny
from rest_framework.r... | <filename>drf_util/views.py
from django.db.models import QuerySet
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import mixins, status
from rest_framework.decorators import permission_classes, api_view
from rest_framework.permissions import AllowAny
from rest_framework.r... | en | 0.215371 | # noqa # noqa # noqa # noqa # noqa # noqa # noqa # return permission_classes depending on `action` # action is not set return default permission_classes # noqa | 1.949055 | 2 |
pychron/processing/xml/primitives.py | aelamspychron/pychron | 1 | 6630634 | # ===============================================================================
# Copyright 2015 <NAME>
#
# 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/LI... | # ===============================================================================
# Copyright 2015 <NAME>
#
# 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/LI... | en | 0.54226 | # =============================================================================== # Copyright 2015 <NAME> # # 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/LI... | 1.400866 | 1 |
feature/volume.py | dev-alberto/fitz_python | 0 | 6630635 | from feature.feature import EmptyFeature
import numpy as np
class Volume(EmptyFeature):
def __init__(self, raw_data_manager, history_lengh=None):
super().__init__(1, raw_data_manager, history_lengh=history_lengh)
def compute(self, data_dict):
volume = data_dict.get('volume')
... | from feature.feature import EmptyFeature
import numpy as np
class Volume(EmptyFeature):
def __init__(self, raw_data_manager, history_lengh=None):
super().__init__(1, raw_data_manager, history_lengh=history_lengh)
def compute(self, data_dict):
volume = data_dict.get('volume')
... | none | 1 | 2.909801 | 3 | |
config_sync.py | tc45/FDM_config_sync | 0 | 6630636 | <reponame>tc45/FDM_config_sync<filename>config_sync.py
import argparse
import logging
import yaml
from fdm import FDMClient
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--config", "-c", help="Path to the configuration file", default="fdm.cfg")
parser.add_argument("--debug... | import argparse
import logging
import yaml
from fdm import FDMClient
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--config", "-c", help="Path to the configuration file", default="fdm.cfg")
parser.add_argument("--debug", "-d", help="Display debug logs", action="store_true"... | de | 0.084149 | # print(cs.fdm.token) | 2.652246 | 3 |
avwx/structs.py | AirbusDriver/avwx-engine | 0 | 6630637 | """
Contains dataclasses to hold report data
"""
# stdlib
import json
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
class _LazyLoad:
source: Path
data: dict = None
def __init__(self, filename: str):
self.source = Path(__file__).parent.joinpath(f"{filen... | """
Contains dataclasses to hold report data
"""
# stdlib
import json
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
class _LazyLoad:
source: Path
data: dict = None
def __init__(self, filename: str):
self.source = Path(__file__).parent.joinpath(f"{filen... | en | 0.57032 | Contains dataclasses to hold report data # stdlib Load an Aircraft from an ICAO aircraft code # @dataclass # class AirepData(ReportData): # pass | 2.988961 | 3 |
lmdb/home/migrations/0006_auto_20161101_0622.py | huzaifafaruqui/Movies-Website | 11 | 6630638 | <reponame>huzaifafaruqui/Movies-Website
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-11-01 06:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0005_movie_genre'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-11-01 06:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0005_movie_genre'),
]
operations = [
migrations.AlterField(
... | en | 0.819662 | # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-11-01 06:22 | 1.556215 | 2 |
jyotisha/panchaanga/writer/table/day_details.py | Prabhakaran-cbe/jyotisha | 40 | 6630639 | from indic_transliteration import sanscript
from jyotisha.panchaanga.spatio_temporal import City
from jyotisha.panchaanga.temporal import names, AngaType, era
from jyotisha.panchaanga.temporal.festival import rules
from jyotisha.panchaanga.temporal.festival.rules import RulesRepo
ujjain = City.get_city_from_db(name="U... | from indic_transliteration import sanscript
from jyotisha.panchaanga.spatio_temporal import City
from jyotisha.panchaanga.temporal import names, AngaType, era
from jyotisha.panchaanga.temporal.festival import rules
from jyotisha.panchaanga.temporal.festival.rules import RulesRepo
ujjain = City.get_city_from_db(name="U... | none | 1 | 2.310549 | 2 | |
torchpruner/operator/operator.py | Ocean-627/torch-model-compression | 86 | 6630640 | import onnxruntime.backend
import onnx
import onnxruntime
import torch
from collections import OrderedDict
from onnx import AttributeProto, TensorProto, GraphProto, helper, shape_inference
import torchpruner.register as register
from onnx import numpy_helper
from onnx import version_converter
import numpy as np
import ... | import onnxruntime.backend
import onnx
import onnxruntime
import torch
from collections import OrderedDict
from onnx import AttributeProto, TensorProto, GraphProto, helper, shape_inference
import torchpruner.register as register
from onnx import numpy_helper
from onnx import version_converter
import numpy as np
import ... | en | 0.418201 | # define the OperatorNode data structure # the operator node will be filled at the build graph # node name # inputs # outputs # fix the torch operator error # node name # inputs # outputs # name=out_data_node_names[i] | 2.173624 | 2 |
tests/mixins.py | ShadowJonathan/txredisapi | 104 | 6630641 | # coding: utf-8
# Copyright 2009 <NAME>
#
# 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 wr... | # coding: utf-8
# Copyright 2009 <NAME>
#
# 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 wr... | en | 0.826061 | # coding: utf-8 # Copyright 2009 <NAME> # # 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 wr... | 2.177031 | 2 |
google.py | ramanirudh/translate_using_googletrans | 1 | 6630642 |
## Program to translate using google translate
## Do not continuously translate. Give a break of atleast 30 minutes after every job
## Uses googletrans package available in python
## <NAME> ## 30 Dec 2019
## Filenames are hard-coded. To translate a file, please search "Input" comment line and type filename in the "ope... |
## Program to translate using google translate
## Do not continuously translate. Give a break of atleast 30 minutes after every job
## Uses googletrans package available in python
## <NAME> ## 30 Dec 2019
## Filenames are hard-coded. To translate a file, please search "Input" comment line and type filename in the "ope... | en | 0.712814 | ## Program to translate using google translate ## Do not continuously translate. Give a break of atleast 30 minutes after every job ## Uses googletrans package available in python ## <NAME> ## 30 Dec 2019 ## Filenames are hard-coded. To translate a file, please search "Input" comment line and type filename in the "open... | 2.995114 | 3 |
frappe/core/doctype/role_profile/test_role_profile.py | ssuda777/frappe | 1 | 6630643 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and Contributors
# See license.txt
import frappe
import unittest
test_dependencies = ['Role']
class TestRoleProfile(unittest.TestCase):
def test_make_new_role_profile(self):
new_role_profile = frappe.get_doc(dict(doctype='Role Profile', role_profile... | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and Contributors
# See license.txt
import frappe
import unittest
test_dependencies = ['Role']
class TestRoleProfile(unittest.TestCase):
def test_make_new_role_profile(self):
new_role_profile = frappe.get_doc(dict(doctype='Role Profile', role_profile... | en | 0.720451 | # -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies and Contributors # See license.txt # add role # clear roles | 2.48884 | 2 |
googlecode-issues-exporter/issues.py | ballschin52/support-tools | 41 | 6630644 | <filename>googlecode-issues-exporter/issues.py<gh_stars>10-100
# Copyright 2014 Google Inc. 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/... | <filename>googlecode-issues-exporter/issues.py<gh_stars>10-100
# Copyright 2014 Google Inc. 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/... | en | 0.870394 | # Copyright 2014 Google Inc. 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 applicable law or a... | 2.510388 | 3 |
tests/test_helper.py | whitemike889/braintree_python | 1 | 6630645 | <reponame>whitemike889/braintree_python<gh_stars>1-10
import json
import os
import re
import random
import sys
import unittest
import warnings
import subprocess
import time
from urllib.parse import urlencode, quote_plus
from http.client import HTTPConnection
from base64 import encodebytes
import requests
from base64 ... | import json
import os
import re
import random
import sys
import unittest
import warnings
import subprocess
import time
from urllib.parse import urlencode, quote_plus
from http.client import HTTPConnection
from base64 import encodebytes
import requests
from base64 import b64decode
from contextlib import contextmanager... | de | 0.211761 | #pylint: disable=E0602 | 1.980059 | 2 |
tilapia/lib/secret/keys/ed25519.py | huazhouwang/python_multichain_wallet | 2 | 6630646 | from typing import Tuple
from nacl import exceptions as nacl_exceptions
from nacl import signing
from tilapia.lib.basic.functional.require import require
from tilapia.lib.secret.interfaces import KeyInterface
class ED25519(KeyInterface):
def __init__(self, prvkey: bytes = None, pubkey: bytes = None):
su... | from typing import Tuple
from nacl import exceptions as nacl_exceptions
from nacl import signing
from tilapia.lib.basic.functional.require import require
from tilapia.lib.secret.interfaces import KeyInterface
class ED25519(KeyInterface):
def __init__(self, prvkey: bytes = None, pubkey: bytes = None):
su... | none | 1 | 2.102165 | 2 | |
src/movie_assistant_trainner.py | VP-DE-ML/if_a_movie_assistant | 0 | 6630647 | import tensorflow as tf
import json
import numpy as np
import keras
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
import pickle
import random
import os
from keras.preprocessing.text import Tokenizer
# fr... | import tensorflow as tf
import json
import numpy as np
import keras
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
import pickle
import random
import os
from keras.preprocessing.text import Tokenizer
# fr... | en | 0.732383 | # from keras.utils.np_utils import to_categorical # review # Save model and components # Save Keras Tokenizer # Save unique intents # Save model # Save weights # count = 0 MOre behind # count = count+1 # Prepare embedding matrix # words not found in embedding index will be all-zeros. # This includes the representation ... | 2.48919 | 2 |
tools/sync_rses.py | faluchet/rucio | 0 | 6630648 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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... | en | 0.753751 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # 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... | 1.976728 | 2 |
django_thermostat/pypelib/persistence/PersistenceEngine.py | jpardobl/django-thermostat | 0 | 6630649 | import os
import sys
import time
'''
@author: msune,omoya,CarolinaFernandez
@@organization: i2CAT, OFELIA FP7
Persistence engine
Implementes driver-based persistence backend selection
'''
class PersistenceEngine():
#Default Class Attributes
_defaultParser = "RegexParser"
_defaultPersistence = ... | import os
import sys
import time
'''
@author: msune,omoya,CarolinaFernandez
@@organization: i2CAT, OFELIA FP7
Persistence engine
Implementes driver-based persistence backend selection
'''
class PersistenceEngine():
#Default Class Attributes
_defaultParser = "RegexParser"
_defaultPersistence = ... | en | 0.698223 | @author: msune,omoya,CarolinaFernandez @@organization: i2CAT, OFELIA FP7 Persistence engine Implementes driver-based persistence backend selection #Default Class Attributes #Drivers #Fill with appropiate path Retrieves every Driver's PolicyRuleTable object for a given name. This method should be seldom used... | 2.325096 | 2 |
custom_components/meross_lan/config_flow.py | gelokatil/meross_lan | 0 | 6630650 | """Config flow for Meross IoT local LAN integration."""
from time import time
import voluptuous as vol
from typing import OrderedDict
import json
try:
from pytz import common_timezones
except Exception:
common_timezones = None
from homeassistant import config_entries
from homeassistant.helpers.typing import Di... | """Config flow for Meross IoT local LAN integration."""
from time import time
import voluptuous as vol
from typing import OrderedDict
import json
try:
from pytz import common_timezones
except Exception:
common_timezones = None
from homeassistant import config_entries
from homeassistant.helpers.typing import Di... | en | 0.886231 | Config flow for Meross IoT local LAN integration. Handle a config flow for Meross IoT local LAN. # we could get here from user flow start in UI # or following dhcp discovery # check we already configured the hub .. Handle a flow initialized by DHCP discovery. we'll update the unique_id for the flow when we'll have the ... | 2.256241 | 2 |