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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_rand.py | yl3dy/pylibressl | 2 | 6624251 | <reponame>yl3dy/pylibressl
import pytest
from pylibressl.rand import get_random_bytes, libressl_get_random_bytes
from pylibressl.rand import getrandbits
class GenericRandTest:
_randfunc = (None,) # ugly hack to prevent making _randfunc a method
def test_too_short_length(self):
_randfunc = self._ran... | import pytest
from pylibressl.rand import get_random_bytes, libressl_get_random_bytes
from pylibressl.rand import getrandbits
class GenericRandTest:
_randfunc = (None,) # ugly hack to prevent making _randfunc a method
def test_too_short_length(self):
_randfunc = self._randfunc[0]
with pytes... | en | 0.623094 | # ugly hack to prevent making _randfunc a method | 2.336395 | 2 |
lilypadz/__init__.py | Weiqi97/LilyPadz | 2 | 6624252 | """Project structure."""
| """Project structure."""
| en | 0.659098 | Project structure. | 1.021487 | 1 |
hic/diffusionTesting.py | zelhar/mg21 | 0 | 6624253 | if __name__ == '__main__':
from mymodule import *
else:
from .mymodule import *
A = np.random.rand(10,8) * 1e-5
plt.matshow(A)
filepath1 = "./hicdata/191-98_hg19_no_hap_EBV_MAPQ30_merged.mcool"
bedpath = "./hicdata/191-98_reconstruction.bed"
filepath2 = "./hicdata/CL17-08_hg19_no_hap_EBV_MAPQ30_merged.mcoo... | if __name__ == '__main__':
from mymodule import *
else:
from .mymodule import *
A = np.random.rand(10,8) * 1e-5
plt.matshow(A)
filepath1 = "./hicdata/191-98_hg19_no_hap_EBV_MAPQ30_merged.mcool"
bedpath = "./hicdata/191-98_reconstruction.bed"
filepath2 = "./hicdata/CL17-08_hg19_no_hap_EBV_MAPQ30_merged.mcoo... | en | 0.894507 | # no bed it's the reference matrix # loading cooler matrix with cooler's API # slicing by chromosomes # column normalize: # loading cooler matrix with cooler's API # slicing by chromosomes | 2.163982 | 2 |
feets/tests/test_original_FATS_test_library.py | ryanjmccall/feets | 0 | 6624254 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2015, 2016, 2017, 2018
# <NAME>, <NAME>, <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2015, 2016, 2017, 2018
# <NAME>, <NAME>, <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | en | 0.672153 | #!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2015, 2016, 2017, 2018 # <NAME>, <NAME>, <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without r... | 1.387776 | 1 |
sikfa.py | SHI3DO/sikfa | 1 | 6624255 | import torch
dtype = torch.float
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
global loss
def find(x: list, y: list, weightsnum: int, trainnum: int, learning_rate: float):
global loss
x2 = torch.FloatTensor(x)
y2 = torch.FloatTensor(y)
coefficient_list = []
for i in r... | import torch
dtype = torch.float
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
global loss
def find(x: list, y: list, weightsnum: int, trainnum: int, learning_rate: float):
global loss
x2 = torch.FloatTensor(x)
y2 = torch.FloatTensor(y)
coefficient_list = []
for i in r... | none | 1 | 2.695684 | 3 | |
examples/development/simulate_policy.py | bandofstraycats/dr-sac | 0 | 6624256 | import argparse
from distutils.util import strtobool
import json
import os
import pickle
import tensorflow as tf
from softlearning.environments.utils import get_environment_from_params
from softlearning.policies.utils import get_policy_from_variant
from softlearning.samplers import rollouts
from softlearning.misc.uti... | import argparse
from distutils.util import strtobool
import json
import os
import pickle
import tensorflow as tf
from softlearning.environments.utils import get_environment_from_params
from softlearning.policies.utils import get_policy_from_variant
from softlearning.samplers import rollouts
from softlearning.misc.uti... | en | 0.764365 | Compute evaluation metrics for the given rollouts. | 1.977108 | 2 |
scripts/practice/FB/MaximumSumBSTinBinaryTree.py | bhimeshchauhan/competitive_programming | 0 | 6624257 | """
Maximum Sum BST in Binary Tree
Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only n... | """
Maximum Sum BST in Binary Tree
Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only n... | en | 0.832744 | Maximum Sum BST in Binary Tree Given a binary tree root, return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes ... | 3.830828 | 4 |
dashathon/scraping/scrape_london_data.py | wfrierson/dashathon | 1 | 6624258 | <filename>dashathon/scraping/scrape_london_data.py
from dashathon.scraping.scraping_methods import scrape_london_marathon_urls
from dashathon.scraping.scraping_methods import scrape_london_marathon
headers_london = ['year', 'bib', 'age_group', 'gender', 'country', 'overall', 'rank_gender',
'rank_age_... | <filename>dashathon/scraping/scrape_london_data.py
from dashathon.scraping.scraping_methods import scrape_london_marathon_urls
from dashathon.scraping.scraping_methods import scrape_london_marathon
headers_london = ['year', 'bib', 'age_group', 'gender', 'country', 'overall', 'rank_gender',
'rank_age_... | none | 1 | 3.123307 | 3 | |
gen_fault_codes.py | gitguige/openpilot0.8.9 | 0 | 6624259 | <reponame>gitguige/openpilot0.8.9
import os
import numpy as np
import random
def gen_add_code(trigger_code, trigger, t1, t2, variable, stuck_value, additional_code):
assert(len(variable) == len(stuck_value))
if trigger_code:
code = trigger_code
else:
if len(trigger)>1:
code = 'if %s>=%... | import os
import numpy as np
import random
def gen_add_code(trigger_code, trigger, t1, t2, variable, stuck_value, additional_code):
assert(len(variable) == len(stuck_value))
if trigger_code:
code = trigger_code
else:
if len(trigger)>1:
code = 'if %s>=%s and %s<=%s:' % \
(tr... | en | 0.282757 | ### Write codes to fault library file ### Write codes to fault library file -- for vision effects ########################################################### ### d_rel-add-incRADAR-H1 #' #code.append(gen_add_code(trigger_code, trigger, t1, t2, variable, [delta], '//if '+variable[0]+'>=255:'+'// '+variable[0]+'= 254'))... | 2.792949 | 3 |
download_module.py | ashvinoli/Anime-no-tomodachi | 2 | 6624260 | from tree import *
import pathlib
import sys
import time
import math
no_interruption_mode = False
interruption_response = None
anime_name_response = None
selection_response = None
choice_response = None
if len(sys.argv) == 2: #First argument is file name
lines = []
if os.path.exists("repeat.txt"):
i... | from tree import *
import pathlib
import sys
import time
import math
no_interruption_mode = False
interruption_response = None
anime_name_response = None
selection_response = None
choice_response = None
if len(sys.argv) == 2: #First argument is file name
lines = []
if os.path.exists("repeat.txt"):
i... | en | 0.768484 | #First argument is file name #This function prompts the user to select quality #print(vid_stream_link) #print(download_link) #size = requests.head(download_link).headers.get("Content-length") The headers couldn't be retrieved so I had to comment this out #print(size) #write_to_log_file("Size of episode:\n",size) #perce... | 3.266046 | 3 |
utils.py | sgtlaggy/lagbot | 3 | 6624261 | <reponame>sgtlaggy/lagbot
import os
UPPER_PATH = os.path.split(os.path.abspath(__file__))[0]
def rzip(*iterables):
"""Like builtin `zip`, but uses the right end of longer iterables instead of the left.
Examples:
rzip([1,2,3], [4,5]) -> ((2, 4), (3, 5))
"""
lens = [len(it) for it in iterables]
... | import os
UPPER_PATH = os.path.split(os.path.abspath(__file__))[0]
def rzip(*iterables):
"""Like builtin `zip`, but uses the right end of longer iterables instead of the left.
Examples:
rzip([1,2,3], [4,5]) -> ((2, 4), (3, 5))
"""
lens = [len(it) for it in iterables]
min_len = min(lens)
... | en | 0.67431 | Like builtin `zip`, but uses the right end of longer iterables instead of the left. Examples: rzip([1,2,3], [4,5]) -> ((2, 4), (3, 5)) Similar to `gettext.ngettext`, but returns a string including the number. `fmt` is an optional format string with fields `{n}` and `{s}` being replaced by the number a... | 3.647791 | 4 |
Curso_de_Python_ Curso_em_Video/PythonExercicios/ex107a112/utilidades/dados/__init__.py | DanilooSilva/Cursos_de_Python | 0 | 6624262 | <gh_stars>0
def leiaDienheiro(msg):
while True:
leia = str(input(msg))
if leia.replace(',', '').replace('.', '').isdigit():
valor = leia.replace(',', '.')
return float(valor)
break
else:
print(f'\033[031mERRO! \'{leia}\' é um preço inválido!\03... | def leiaDienheiro(msg):
while True:
leia = str(input(msg))
if leia.replace(',', '').replace('.', '').isdigit():
valor = leia.replace(',', '.')
return float(valor)
break
else:
print(f'\033[031mERRO! \'{leia}\' é um preço inválido!\033[m') | none | 1 | 3.47558 | 3 | |
test_arm_ric/test_by_phone.py | OlesyaF/basic_tests_zvs | 0 | 6624263 | # -*- encoding: utf-8 -*-
import time
import allure
# Проверка изменения информации о Горячей линии РИЦ на вкладке По телефону
@allure.title("Проверка изменения информации о Горячей линии РИЦ на вкладке По телефону")
def test_change_hotline_info(app):
print("test_change_hotline_info.py is running")
num = s... | # -*- encoding: utf-8 -*-
import time
import allure
# Проверка изменения информации о Горячей линии РИЦ на вкладке По телефону
@allure.title("Проверка изменения информации о Горячей линии РИЦ на вкладке По телефону")
def test_change_hotline_info(app):
print("test_change_hotline_info.py is running")
num = s... | ru | 0.899669 | # -*- encoding: utf-8 -*- # Проверка изменения информации о Горячей линии РИЦ на вкладке По телефону | 2.43538 | 2 |
pyrez/models/BaseMatchDetail.py | CLeendert/Pyrez | 25 | 6624264 | from .MatchBase import MatchBase
class BaseMatchDetail(MatchBase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.damageBot = kwargs.get("Damage_Bot", 0) or 0
self.damageDoneInHand = kwargs.get("Damage_Done_In_Hand", 0) or 0
self.damageDoneMagical = kwargs.get("Damage_... | from .MatchBase import MatchBase
class BaseMatchDetail(MatchBase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.damageBot = kwargs.get("Damage_Bot", 0) or 0
self.damageDoneInHand = kwargs.get("Damage_Done_In_Hand", 0) or 0
self.damageDoneMagical = kwargs.get("Damage_... | none | 1 | 2.232028 | 2 | |
class 2708/exercise1.py | Gabriel-Fernandes1917/lab-the-python | 0 | 6624265 | <reponame>Gabriel-Fernandes1917/lab-the-python
dictionary ={None:None}
loop = "sim"
while(loop == "sim"):
dictionary[0]=input('informe o nome\n')
dictionary[1]=input('informe o cpf\n')
loop = input('deseja continuar ?')
print(dictionary)
| dictionary ={None:None}
loop = "sim"
while(loop == "sim"):
dictionary[0]=input('informe o nome\n')
dictionary[1]=input('informe o cpf\n')
loop = input('deseja continuar ?')
print(dictionary) | none | 1 | 3.865597 | 4 | |
iqmon/pipelines/ingest.py | joshwalawender/IQMon | 9 | 6624266 | <filename>iqmon/pipelines/ingest.py
from keckdrpframework.pipelines.base_pipeline import BasePipeline
from keckdrpframework.models.processing_context import ProcessingContext
# MODIFY THIS IMPORT to reflect the name of the module created in the primitives directory
from iqmon.primitives.file_handling import (ReadF... | <filename>iqmon/pipelines/ingest.py
from keckdrpframework.pipelines.base_pipeline import BasePipeline
from keckdrpframework.models.processing_context import ProcessingContext
# MODIFY THIS IMPORT to reflect the name of the module created in the primitives directory
from iqmon.primitives.file_handling import (ReadF... | en | 0.928398 | # MODIFY THIS IMPORT to reflect the name of the module created in the primitives directory This pipeline ingests files from their raw location on disk and rewrites
them to the destination directory with a checksum. It then (if spcified)
deletes the original file. Finally, some basic image information and
... | 2.200226 | 2 |
slybot/slybot/fieldtypes/images.py | hackrush01/portia | 6,390 | 6624267 | """Images."""
from scrapely.extractors import extract_image_url
from slybot.fieldtypes.url import UrlFieldTypeProcessor
class ImagesFieldTypeProcessor(UrlFieldTypeProcessor):
name = 'image'
description = 'extracts image URLs'
def extract(self, text):
if text is not None:
return extrac... | """Images."""
from scrapely.extractors import extract_image_url
from slybot.fieldtypes.url import UrlFieldTypeProcessor
class ImagesFieldTypeProcessor(UrlFieldTypeProcessor):
name = 'image'
description = 'extracts image URLs'
def extract(self, text):
if text is not None:
return extrac... | none | 1 | 2.949233 | 3 | |
test/uw_spot/spot_post.py | sbutler/spotseeker_server | 0 | 6624268 | <filename>test/uw_spot/spot_post.py<gh_stars>0
""" Copyright 2012, 2013 UW Information Technology, University of Washington
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://ww... | <filename>test/uw_spot/spot_post.py<gh_stars>0
""" Copyright 2012, 2013 UW Information Technology, University of Washington
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://ww... | en | 0.841316 | Copyright 2012, 2013 UW Information Technology, University of Washington Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless requi... | 1.961097 | 2 |
version_2.0/help_scripts/bot_logic/extension_functions_compiled.py | Isak-Landin/AlienWorldsBot | 0 | 6624269 | <filename>version_2.0/help_scripts/bot_logic/extension_functions_compiled.py<gh_stars>0
from selenium import webdriver
import time
import random
import json
from help_scripts import selenium_operator as sop
import traceback
from help_scripts import bot_actions
from help_scripts import get_proxies
from pathlib import Pa... | <filename>version_2.0/help_scripts/bot_logic/extension_functions_compiled.py<gh_stars>0
from selenium import webdriver
import time
import random
import json
from help_scripts import selenium_operator as sop
import traceback
from help_scripts import bot_actions
from help_scripts import get_proxies
from pathlib import Pa... | en | 0.229378 | # /html/body/div[5]/div[2]/div/div/div[2]/div[2]/div window.open("http://www.blankwebsite.com/", "_blank"); | 2.290654 | 2 |
chmap/data/corrections/lbcc/LBCC_create_mu-hist.py | predsci/CHD | 3 | 6624270 | <reponame>predsci/CHD<filename>chmap/data/corrections/lbcc/LBCC_create_mu-hist.py
"""
construct mu-histogram and push to database for any time period
"""
import os
# This can be a computationally intensive process.
# To limit number of threads numpy can spawn:
# os.environ["OMP_NUM_THREADS"] = "4"
import time
import... | """
construct mu-histogram and push to database for any time period
"""
import os
# This can be a computationally intensive process.
# To limit number of threads numpy can spawn:
# os.environ["OMP_NUM_THREADS"] = "4"
import time
import datetime
import numpy as np
from chmap.settings.app import App
import chmap.datab... | en | 0.717887 | construct mu-histogram and push to database for any time period # This can be a computationally intensive process. # To limit number of threads numpy can spawn: # os.environ["OMP_NUM_THREADS"] = "4" ###### ------ PARAMETERS TO UPDATE -------- ######## # TIME RANGE # define instruments and wavelengths to include # defin... | 2.451869 | 2 |
examples/pyScripts/setDesiredEstimator.py | pseudoPixels/bokehBot | 2 | 6624271 | <reponame>pseudoPixels/bokehBot
import iSeaborn as isn
from bokeh.plotting import output_file, save
from numpy import median
tips = isn.load_dataset("tips")
fig = isn.barplot(x="day", y="tip", data=tips, estimator=median)
output_file("setDesiredEstimator.html")
save(fig)
| import iSeaborn as isn
from bokeh.plotting import output_file, save
from numpy import median
tips = isn.load_dataset("tips")
fig = isn.barplot(x="day", y="tip", data=tips, estimator=median)
output_file("setDesiredEstimator.html")
save(fig) | none | 1 | 2.525855 | 3 | |
airflow/modules/tests/proxypool/test_proxypool_validator.py | phuonglvh/DataEngineeringProject | 417 | 6624272 | from unittest.mock import patch
from proxypool import ProxyPoolValidator
from ..fixtures import web_parser, raw_content, proxy_record
@patch("parser.web_parser.WebParser.get_content")
def test_validate_proxy(get_content, raw_content, web_parser, proxy_record):
expected = True
get_content.return_value = raw_... | from unittest.mock import patch
from proxypool import ProxyPoolValidator
from ..fixtures import web_parser, raw_content, proxy_record
@patch("parser.web_parser.WebParser.get_content")
def test_validate_proxy(get_content, raw_content, web_parser, proxy_record):
expected = True
get_content.return_value = raw_... | none | 1 | 2.777025 | 3 | |
examples/local/execute_module.py | wils0ns/saltypie | 1 | 6624273 | import logging
from saltypie import Salt
LOG = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
def main():
salt = Salt(
url='https://localhost:8000',
username='admin',
passwd='<PASSWORD>',
trust_host=True
)
salt.eauth = 'pam'
ret = salt.local_async(
... | import logging
from saltypie import Salt
LOG = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
def main():
salt = Salt(
url='https://localhost:8000',
username='admin',
passwd='<PASSWORD>',
trust_host=True
)
salt.eauth = 'pam'
ret = salt.local_async(
... | none | 1 | 2.309823 | 2 | |
app_stanford.py | ilos-vigil/id-pos-tagger | 0 | 6624274 | # source : https://stanfordnlp.github.io/stanfordnlp/pos.html
import stanfordnlp
nlp = stanfordnlp.Pipeline(processors='tokenize,mwt,pos', lang='id')
doc = nlp('Bahasa Indonesia adalah bahasa Melayu yang dijadikan sebagai bahasa resmi Republik Indonesia dan bahasa persatuan bangsa Indonesia. '
'Bahasa Indonesia di... | # source : https://stanfordnlp.github.io/stanfordnlp/pos.html
import stanfordnlp
nlp = stanfordnlp.Pipeline(processors='tokenize,mwt,pos', lang='id')
doc = nlp('Bahasa Indonesia adalah bahasa Melayu yang dijadikan sebagai bahasa resmi Republik Indonesia dan bahasa persatuan bangsa Indonesia. '
'Bahasa Indonesia di... | en | 0.195268 | # source : https://stanfordnlp.github.io/stanfordnlp/pos.html | 2.82337 | 3 |
Lesson 10/MinPerimeterRectangle.py | whirlpool27/codility-lessons-solution | 1 | 6624275 | <filename>Lesson 10/MinPerimeterRectangle.py
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N):
# write your code in Python 3.6
factorCandidate = 1
minPerimeter = 4_000_000_000
while factorCandidate*factorCandidate <= N:
if N % facto... | <filename>Lesson 10/MinPerimeterRectangle.py
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N):
# write your code in Python 3.6
factorCandidate = 1
minPerimeter = 4_000_000_000
while factorCandidate*factorCandidate <= N:
if N % facto... | en | 0.754381 | # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") # write your code in Python 3.6 | 3.633426 | 4 |
labs/lab4/backend/config.py | alice-cloud/dockerAndK8s | 0 | 6624276 | <gh_stars>0
import os
class Config(object):
REDIS_URL = "redis://{}:6379/0".format(os.environ.get("REDIS_SERVER"))
SECRET_KEY = 'oh_so_secret'
FLASK_PIKA_PARAMS = {
'host':'amqp', #amqp.server.com
'username': 'guest', #convenience param for username
'password': '<PASSWORD>', ... | import os
class Config(object):
REDIS_URL = "redis://{}:6379/0".format(os.environ.get("REDIS_SERVER"))
SECRET_KEY = 'oh_so_secret'
FLASK_PIKA_PARAMS = {
'host':'amqp', #amqp.server.com
'username': 'guest', #convenience param for username
'password': '<PASSWORD>', #convenienc... | en | 0.365617 | #amqp.server.com #convenience param for username #convenience param for password #amqp server port #amqp vhost | 2.161572 | 2 |
src/utils/cn2arab.py | aquadrop/memory | 2 | 6624277 | import pycnnum
chs_arabic_map = {'零': 0, '一': 1, '二': 2, '三': 3, '四': 4,
'五': 5, '六': 6, '七': 7, '八': 8, '九': 9,
'十': 10, '百': 100, '千': 1000, '万': 10000,
'〇': 0, '壹': 1, '贰': 2, '叁': 3, '肆': 4,
'伍': 5, '陆': 6, '柒': 7, '捌': 8, '玖': 9,
... | import pycnnum
chs_arabic_map = {'零': 0, '一': 1, '二': 2, '三': 3, '四': 4,
'五': 5, '六': 6, '七': 7, '八': 8, '九': 9,
'十': 10, '百': 100, '千': 1000, '万': 10000,
'〇': 0, '壹': 1, '贰': 2, '叁': 3, '肆': 4,
'伍': 5, '陆': 6, '柒': 7, '捌': 8, '玖': 9,
... | ja | 0.308412 | # if char in convert_list: # char = convert_list[char] # chinese_digits = chinese_digits.decode("utf-8") # print 'prefix', _uniout.unescape(str(prefix), 'utf-8') # print 'digit', _uniout.unescape(str(digit), 'utf-8') # print 'suffix', _uniout.unescape(str(suffix), 'utf-8') ## 100百万,取出100这个数字 # meet 「亿」 or 「億」 # get... | 2.24685 | 2 |
encurtador_de_url.py | evertoont/Projetos_diversos | 1 | 6624278 | <reponame>evertoont/Projetos_diversos<filename>encurtador_de_url.py
'''
Script realiza um encurtamento da URL usando o TinyURL.
Após ser encurtada, a URL é copiada para área de transferência.
- Necessário instalar as lib pyshorteners e clipboard
- pip install pyshorteners
- pip install clipboard
'''
import pyshortene... | '''
Script realiza um encurtamento da URL usando o TinyURL.
Após ser encurtada, a URL é copiada para área de transferência.
- Necessário instalar as lib pyshorteners e clipboard
- pip install pyshorteners
- pip install clipboard
'''
import pyshorteners
import clipboard
url = input("Digite url a ser encurtada: ")
ur... | pt | 0.815814 | Script realiza um encurtamento da URL usando o TinyURL. Após ser encurtada, a URL é copiada para área de transferência. - Necessário instalar as lib pyshorteners e clipboard - pip install pyshorteners - pip install clipboard | 4.0688 | 4 |
models.py | atxarib99/stonks | 0 | 6624279 | <reponame>atxarib99/stonks
# holds different models that can be pulled into the learner.
# each method takes data as input and will output cleaned data and model
import tensorflow as tf
import numpy as np
import pandas as pd
def singleHighOutput(data, lstm_layer_size=128, lstm_layer_count=2):
dataset_x = []
da... | # holds different models that can be pulled into the learner.
# each method takes data as input and will output cleaned data and model
import tensorflow as tf
import numpy as np
import pandas as pd
def singleHighOutput(data, lstm_layer_size=128, lstm_layer_count=2):
dataset_x = []
dataset_y = []
train_x =... | en | 0.945008 | # holds different models that can be pulled into the learner. # each method takes data as input and will output cleaned data and model #reshape #reshape #reshape #80:20 test train split | 2.841473 | 3 |
app/bot/base.py | anderskswanson/xtensible | 1 | 6624280 | <reponame>anderskswanson/xtensible<gh_stars>1-10
from inspect import getmembers
import importlib
import os
class BaseModule:
"""
Module of native features for XtensibleBot
Available functions:
- lsmod
- describemod
- addmod
- delmod
- help
"""
_NOT_LOADED = 'Module {} is not l... | from inspect import getmembers
import importlib
import os
class BaseModule:
"""
Module of native features for XtensibleBot
Available functions:
- lsmod
- describemod
- addmod
- delmod
- help
"""
_NOT_LOADED = 'Module {} is not loaded into Xtensible-Bot'
def __init__(self)... | en | 0.381062 | Module of native features for XtensibleBot Available functions: - lsmod - describemod - addmod - delmod - help # add a module script into the module list Internal representation of lsmod !base keys # merge iterable of module names or string module name into the module dict Add module/s f... | 2.409501 | 2 |
Besttimetobuyandsellstock.py | pgupta119/LeetCode | 0 | 6624281 | # You are given an array prices where prices[i] is the price of a given stock on the ith day.
# You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
# Return the maximum profit you can achieve from this transaction. If you cannot ach... | # You are given an array prices where prices[i] is the price of a given stock on the ith day.
# You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
# Return the maximum profit you can achieve from this transaction. If you cannot ach... | en | 0.873971 | # You are given an array prices where prices[i] is the price of a given stock on the ith day. # You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. # Return the maximum profit you can achieve from this transaction. If you cannot achie... | 4.252072 | 4 |
Shop/migrations/0010_auto_20210506_2155.py | KumarSantosh22/TheShoppingCArt | 0 | 6624282 | # Generated by Django 3.1.7 on 2021-05-06 16:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Shop', '0009_auto_20210506_2154'),
]
operations = [
migrations.AlterField(
model_name='seller',
name='phone',
... | # Generated by Django 3.1.7 on 2021-05-06 16:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Shop', '0009_auto_20210506_2154'),
]
operations = [
migrations.AlterField(
model_name='seller',
name='phone',
... | en | 0.7881 | # Generated by Django 3.1.7 on 2021-05-06 16:25 | 1.501177 | 2 |
uscensus/__init__.py | nkrishnaswami/census | 4 | 6624283 | <reponame>nkrishnaswami/census
from .data.discovery import DiscoveryInterface
from .data.states import get_state_codes
from .geocode.bulk import CensusBulkGeocoder
from .util.errors import CensusError
from .util.errors import DBError
from .util.nopcache import NopCache
from .util.sqlalchemycache import SqlAlchemyCache
... | from .data.discovery import DiscoveryInterface
from .data.states import get_state_codes
from .geocode.bulk import CensusBulkGeocoder
from .util.errors import CensusError
from .util.errors import DBError
from .util.nopcache import NopCache
from .util.sqlalchemycache import SqlAlchemyCache
"""This module reads the Censu... | en | 0.726619 | This module reads the Census's API discovery interface at http://api.census.gov/data.json, and provides callable wrappers for each API it finds. It indexes each of their metadata fields to make the APIs and variables related to them easier to find. The fields in the dataset discovery interface are described at https:... | 2.457949 | 2 |
riptide_engine_docker/container_builder.py | theCapypara/riptide-engine-docker | 1 | 6624284 | <filename>riptide_engine_docker/container_builder.py
"""Container builder module."""
from collections import OrderedDict
import os
import platform
from pathlib import PurePosixPath
from typing import List, Union
from docker.types import Mount, Ulimit
from riptide.config.document.command import Command
from riptide.c... | <filename>riptide_engine_docker/container_builder.py
"""Container builder module."""
from collections import OrderedDict
import os
import platform
from pathlib import PurePosixPath
from typing import List, Union
from docker.types import Mount, Ulimit
from riptide.config.document.command import Command
from riptide.c... | en | 0.818224 | Container builder module. # For services map HTTP main port to a host port starting here ContainerBuilder. Builds Riptide Docker containers for use with the Python API and the Docker CLI Create a new container builder. Specify image and command to run. # Performance setting for Docker Desktop on Mac Add a named... | 1.964997 | 2 |
nmeta/api_definitions/switches_api.py | mattjhayes/nmeta | 18 | 6624285 | <filename>nmeta/api_definitions/switches_api.py
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | <filename>nmeta/api_definitions/switches_api.py
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | en | 0.836088 | # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the... | 1.55326 | 2 |
apps/gsekit/process/models.py | iSecloud/bk-process-config-manager | 8 | 6624286 | <filename>apps/gsekit/process/models.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸 (Blueking) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except... | <filename>apps/gsekit/process/models.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸 (Blueking) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except... | en | 0.818072 | # -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸 (Blueking) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt... | 1.735579 | 2 |
day4/task.py | dsky1990/python_30days | 1 | 6624287 | <reponame>dsky1990/python_30days
# def fib(max):
# n, a, b = 0, 0, 1
# while n < max:
# print(b)
# a, b = b, a + b
# n = n + 1
# else:
# print('done')
# fib(9)
def fib(max):
n, a, b = 0, 0, 1
while n < max:
yield b
a, b = b, a + b
n += 1
... | # def fib(max):
# n, a, b = 0, 0, 1
# while n < max:
# print(b)
# a, b = b, a + b
# n = n + 1
# else:
# print('done')
# fib(9)
def fib(max):
n, a, b = 0, 0, 1
while n < max:
yield b
a, b = b, a + b
n += 1
return "done"
n = fib(10)
whi... | en | 0.506416 | # def fib(max): # n, a, b = 0, 0, 1 # while n < max: # print(b) # a, b = b, a + b # n = n + 1 # else: # print('done') # fib(9) | 3.888305 | 4 |
bakery_cli/pipe/__init__.py | jessamynsmith/fontbakery | 0 | 6624288 | from bakery_cli.pipe.copy import (Copy, CopyLicense, CopyDescription, CopyTxtFiles,
CopyFontLog, CopyMetadata)
from bakery_cli.pipe.build import Build
from bakery_cli.pipe.ttfautohint import TTFAutoHint
from bakery_cli.pipe.pyftsubset import PyFtSubset
from bakery_cli.pipe.pyfontaine import P... | from bakery_cli.pipe.copy import (Copy, CopyLicense, CopyDescription, CopyTxtFiles,
CopyFontLog, CopyMetadata)
from bakery_cli.pipe.build import Build
from bakery_cli.pipe.ttfautohint import TTFAutoHint
from bakery_cli.pipe.pyftsubset import PyFtSubset
from bakery_cli.pipe.pyfontaine import P... | none | 1 | 1.201987 | 1 | |
flashpandas/pages/create.py | MaxTechniche/flash-pandas | 0 | 6624289 | import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, State, Input
from pymongo.errors import DuplicateKeyError
from flask import session
from flashpandas.app import APP, users, cards, Card
logged_out_layout = html.Div(
... | import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, State, Input
from pymongo.errors import DuplicateKeyError
from flask import session
from flashpandas.app import APP, users, cards, Card
logged_out_layout = html.Div(
... | hu | 0.348993 | #C8E4F4", #C8E4F4", | 2.334763 | 2 |
combat.py | tawnkramer/Adventure | 2 | 6624290 | import random
from prettytable import *
from util import *
from commentary import *
HP_RECOVERED_FROM_REST = 1
class CombatStats(object):
COMBAT_STATUS_NONE = 0
COMBAT_STATUS_FIGHTING = 1
COMBAT_STATUS_RAN = 2
COMBAT_STATUS_WON = 3
COMBAT_STATUS_ALL_DIED = 4
def __init__(self):
self.players_died = []
self.... | import random
from prettytable import *
from util import *
from commentary import *
HP_RECOVERED_FROM_REST = 1
class CombatStats(object):
COMBAT_STATUS_NONE = 0
COMBAT_STATUS_FIGHTING = 1
COMBAT_STATUS_RAN = 2
COMBAT_STATUS_WON = 3
COMBAT_STATUS_ALL_DIED = 4
def __init__(self):
self.players_died = []
self.... | en | 0.868608 | #casting spells while in armor happens at a deficit #get input #a list of the player targets. We adjust the frequency of monster focus #by adding attacking players 3 times, spell or blocking characters once. #to simulate fatigue and increasing #likeliness to give and receive damage, #adjust to hit up as rounds go on. #... | 2.874856 | 3 |
app/forms/UpdatePasswordForm.py | jonzxz/project-piscator | 0 | 6624291 | <reponame>jonzxz/project-piscator<filename>app/forms/UpdatePasswordForm.py
from flask_wtf import FlaskForm
from app.models import User
from wtforms import PasswordField, SubmitField, DecimalField
from wtforms.validators import DataRequired
# WTForm for updating password after request for password reset
class UpdatePas... | from flask_wtf import FlaskForm
from app.models import User
from wtforms import PasswordField, SubmitField, DecimalField
from wtforms.validators import DataRequired
# WTForm for updating password after request for password reset
class UpdatePasswordForm(FlaskForm):
token = DecimalField('Six Digit Code'\
, rend... | en | 0.790713 | # WTForm for updating password after request for password reset | 2.74826 | 3 |
mmdglm/convkernels/base.py | adehad/mmd-glm | 0 | 6624292 | <filename>mmdglm/convkernels/base.py<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import fftconvolve
import torch
from ..utils import get_arg_support, get_dt, searchsorted
class Kernel:
def __init__(self):
pass
def interpolate(self, t):
pass
def i... | <filename>mmdglm/convkernels/base.py<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import fftconvolve
import torch
from ..utils import get_arg_support, get_dt, searchsorted
class Kernel:
def __init__(self):
pass
def interpolate(self, t):
pass
def i... | en | 0.672171 | Implements the convolution of a time series with the kernel using scipy fftconvolve. Args: t (array): time points x (array): time series to be convolved mode (str): Returns: array: convolved time series # or to arg_support0 < 0 and len(t) - arg_support0... | 2.177561 | 2 |
dangdang/dangdang/spiders/dd.py | ValueXu/DangDangScrapy | 1 | 6624293 | <reponame>ValueXu/DangDangScrapy
# -*- coding: utf-8 -*-
import scrapy
from dangdang.items import DangdangItem
from scrapy.http import Request
class Ddspider(scrapy.Spider):
name = "dd"
allowed_domains = ["dangdang.com"]
start_urls = ('http://www.dangdang.com/',)
def parse(self, response):
item... | # -*- coding: utf-8 -*-
import scrapy
from dangdang.items import DangdangItem
from scrapy.http import Request
class Ddspider(scrapy.Spider):
name = "dd"
allowed_domains = ["dangdang.com"]
start_urls = ('http://www.dangdang.com/',)
def parse(self, response):
item=DangdangItem()
item["tit... | en | 0.769321 | # -*- coding: utf-8 -*- | 3.02353 | 3 |
033_Search_in_Rotated_Sorted_Array.py | adwardlee/leetcode_solutions | 0 | 6624294 | <reponame>adwardlee/leetcode_solutions<gh_stars>0
'''
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assum... | '''
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
Your algorith... | en | 0.879945 | Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). You are given a target value to search. If found in the array return its index, otherwise return -1. You may assume no duplicate exists in the array. Your algorithm's ... | 3.962535 | 4 |
gsm_layer3_protocol/sms_protocol/rp_data.py | matan1008/gsm-layer3-protocol | 0 | 6624295 | <filename>gsm_layer3_protocol/sms_protocol/rp_data.py
from construct import *
from gsm_layer3_protocol.enums import rp_mti
from gsm_layer3_protocol.sms_protocol.called_party_bcd_address import zero_lengthed_bcd_address, service_center_address
from gsm_layer3_protocol.sms_protocol.sms_submit import sms_submit_tpdu_struc... | <filename>gsm_layer3_protocol/sms_protocol/rp_data.py
from construct import *
from gsm_layer3_protocol.enums import rp_mti
from gsm_layer3_protocol.sms_protocol.called_party_bcd_address import zero_lengthed_bcd_address, service_center_address
from gsm_layer3_protocol.sms_protocol.sms_submit import sms_submit_tpdu_struc... | none | 1 | 2.195377 | 2 | |
_BACKUPS_v3/v3_1/LightPicture_Test.py | nagame/LightPicture | 0 | 6624296 | from LightPicture import *
import unittest
class TestConstructor_Coordinate(unittest.TestCase):
"""
Test Coordinate class calls
"""
def test_none(self):
"""
Calling Coordinates class with no key (kay = None)
"""
c0 = Coordinates()
self.asser... | from LightPicture import *
import unittest
class TestConstructor_Coordinate(unittest.TestCase):
"""
Test Coordinate class calls
"""
def test_none(self):
"""
Calling Coordinates class with no key (kay = None)
"""
c0 = Coordinates()
self.asser... | en | 0.914016 | Test Coordinate class calls Calling Coordinates class with no key (kay = None) Calling Coordinates class with key conaining simple types Calling Coordinates class with key containing specific types # Call Coordinates object with Vertex object as key # # = = = = = = = = = = = = = = = = = = = = = = = = = = = # # Check ... | 3.026361 | 3 |
src/bot_cogs/minecraft.py | ryancflam/-findseed | 0 | 6624297 | <reponame>ryancflam/-findseed
# Credit - https://github.com/Sharpieman20/Sharpies-Speedrunning-Tools
# For blindtravel, doubletravel, educatedtravel, safeblind, triangulation
# Credit - https://github.com/FourGoesFast/PerfectTravelBot
# For divinetravel, perfecttravel
from asyncio import TimeoutError
from base64 impor... | # Credit - https://github.com/Sharpieman20/Sharpies-Speedrunning-Tools
# For blindtravel, doubletravel, educatedtravel, safeblind, triangulation
# Credit - https://github.com/FourGoesFast/PerfectTravelBot
# For divinetravel, perfecttravel
from asyncio import TimeoutError
from base64 import b64decode
from json import l... | en | 0.519113 | # Credit - https://github.com/Sharpieman20/Sharpies-Speedrunning-Tools # For blindtravel, doubletravel, educatedtravel, safeblind, triangulation # Credit - https://github.com/FourGoesFast/PerfectTravelBot # For divinetravel, perfecttravel #1> <z #1> <angle #1> <x #2> <z #2> <angle #2>") #1> <z #1> <x #2> <z #2>\n\nAlte... | 2.119382 | 2 |
pytak/functions.py | joshuafuller/pytak | 22 | 6624298 | <filename>pytak/functions.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PyTAK Functions."""
import asyncio
import datetime
import os
import socket
import ssl
import xml
import xml.etree.ElementTree
import pytak
import pytak.asyncio_dgram
__author__ = "<NAME> W2GMD <<EMAIL>>"
__copyright__ = "Copyright 2021 O... | <filename>pytak/functions.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PyTAK Functions."""
import asyncio
import datetime
import os
import socket
import ssl
import xml
import xml.etree.ElementTree
import pytak
import pytak.asyncio_dgram
__author__ = "<NAME> W2GMD <<EMAIL>>"
__copyright__ = "Copyright 2021 O... | en | 0.437154 | #!/usr/bin/env python # -*- coding: utf-8 -*- PyTAK Functions. Given a host:port and/or port, returns host, port. Parses a Cursor on Target destination URL. Generates a Hello CoT Event. | 2.651839 | 3 |
advenshare.py | ssfrr/adventshare | 0 | 6624299 | <gh_stars>0
HTML_DIR = ''
from flask import Flask, send_from_directory # , request
from flask_sockets import Sockets
from geventwebsocket import WebSocketError
import json
import logging
import coloredlogs
app = Flask(__name__)
sockets = Sockets(app)
coloredlogs.install(logging.INFO)
logger = logging.getLogger(__name... | HTML_DIR = ''
from flask import Flask, send_from_directory # , request
from flask_sockets import Sockets
from geventwebsocket import WebSocketError
import json
import logging
import coloredlogs
app = Flask(__name__)
sockets = Sockets(app)
coloredlogs.install(logging.INFO)
logger = logging.getLogger(__name__)
# list ... | en | 0.941869 | # , request # list of sessions is keyed on their IDs # define message type strings # it's important here that values() makes a copy because we're about to # start mutating the guests dict # this isn't from the active user, so don't send it down # wait for the session offer Tests to make sure all the listed attributes a... | 2.331361 | 2 |
appimagebuilder/recipe/recipe.py | srevinsaju/appimage-builder | 0 | 6624300 | # Copyright 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distr... | # Copyright 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distr... | en | 0.882815 | # Copyright 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distr... | 2.121066 | 2 |
mcs-jr.py | clarkdever/mission-control-station-pi | 0 | 6624301 | import mplayer, evdev
# Joystics
pl1 = evdev.InputDevice('/dev/input/by-path/platform-3f980000.usb-usb-0:1.5:1.0-event-joystick')
pl2 = evdev.InputDevice('/dev/input/by-path/platform-3f980000.usb-usb-0:1.3:1.0-event-joystick')
# Initialize video
p = mplayer.Player()
p.loadfile("ChildrensMCS.mp4")
p.fullstrceen = Tru... | import mplayer, evdev
# Joystics
pl1 = evdev.InputDevice('/dev/input/by-path/platform-3f980000.usb-usb-0:1.5:1.0-event-joystick')
pl2 = evdev.InputDevice('/dev/input/by-path/platform-3f980000.usb-usb-0:1.3:1.0-event-joystick')
# Initialize video
p = mplayer.Player()
p.loadfile("ChildrensMCS.mp4")
p.fullstrceen = Tru... | en | 0.790344 | # Joystics # Initialize video # Disables on-screen UI # How many seconds skipping ahead/back # Player inputs # Dictionary of clips # mplayer's time_pos is None when spinning up the process/loading the video #if ev1 is not None: # No more input, so break out of the loop # Do player 1 stuff here # Button Input # Do playe... | 1.862079 | 2 |
tests/test_cli_mutation_map.py | DerThorsten/kipoi-veff | 5 | 6624302 | import sys
import pytest
import os
import subprocess
import config
if config.install_req:
INSTALL_FLAG = "--install_req"
else:
INSTALL_FLAG = ""
EXAMPLES_TO_RUN = ["rbp"]
@pytest.mark.parametrize("example", EXAMPLES_TO_RUN)
@pytest.mark.parametrize("new_dataloader_kwargs_format", [False, True])
def test_gen... | import sys
import pytest
import os
import subprocess
import config
if config.install_req:
INSTALL_FLAG = "--install_req"
else:
INSTALL_FLAG = ""
EXAMPLES_TO_RUN = ["rbp"]
@pytest.mark.parametrize("example", EXAMPLES_TO_RUN)
@pytest.mark.parametrize("new_dataloader_kwargs_format", [False, True])
def test_gen... | en | 0.58231 | kipoi predict ... # restricted_bed = False # "./", # directory # "./", # directory # run the # make the plot | 1.7612 | 2 |
connectors/interfaces/leaf_connector_interface.py | kefir/snakee | 0 | 6624303 | <reponame>kefir/snakee<gh_stars>0
from abc import ABC, abstractmethod
from typing import Optional
try: # Assume we're a sub-module in a package.
from streams.interfaces.abstract_stream_interface import StreamInterface
from connectors.content_format.content_type import ContentType
from connectors.interface... | from abc import ABC, abstractmethod
from typing import Optional
try: # Assume we're a sub-module in a package.
from streams.interfaces.abstract_stream_interface import StreamInterface
from connectors.content_format.content_type import ContentType
from connectors.interfaces.connector_interface import Conne... | en | 0.845231 | # Assume we're a sub-module in a package. # Apparently no higher-level package has been imported, fall back to a local import. | 2.60356 | 3 |
slither/core/geodetic.py | AlexanderFabisch/slither | 2 | 6624304 | import numpy as np
import pyproj
from .config import config
def haversine_dist(lat1, long1, lat2, long2, earth_radius=6371000.0):
"""Haversine distance between two positions on earth.
This is a simple approximation. A better way is to use pyproj,
which uses a WGS84 model of the earth.
Parameters
... | import numpy as np
import pyproj
from .config import config
def haversine_dist(lat1, long1, lat2, long2, earth_radius=6371000.0):
"""Haversine distance between two positions on earth.
This is a simple approximation. A better way is to use pyproj,
which uses a WGS84 model of the earth.
Parameters
... | en | 0.624181 | Haversine distance between two positions on earth. This is a simple approximation. A better way is to use pyproj, which uses a WGS84 model of the earth. Parameters ---------- lat1 : array-like or float latitude of position 1 in radians long1 : array-like or float longitude of ... | 3.512784 | 4 |
dipy/reconst/dti.py | Garyfallidis/dipy | 3 | 6624305 | <reponame>Garyfallidis/dipy
#!/usr/bin/python
""" Classes and functions for fitting tensors """
# 5/17/2010
import numpy as np
from dipy.reconst.maskedview import MaskedView, _makearray, _filled
from dipy.reconst.modelarray import ModelArray
from dipy.data import get_sphere
class Tensor(ModelArray):
""" Fits a d... | #!/usr/bin/python
""" Classes and functions for fitting tensors """
# 5/17/2010
import numpy as np
from dipy.reconst.maskedview import MaskedView, _makearray, _filled
from dipy.reconst.modelarray import ModelArray
from dipy.data import get_sphere
class Tensor(ModelArray):
""" Fits a diffusion tensor given diffus... | en | 0.684925 | #!/usr/bin/python Classes and functions for fitting tensors # 5/17/2010 Fits a diffusion tensor given diffusion-weighted signals and gradient info Tensor object that when initialized calculates single self diffusion tensor [1]_ in each voxel using selected fitting algorithm (DEFAULT: weighted least squares... | 3.000198 | 3 |
statistics/hyphotesis/testing.py | Fernakamuta/machine | 0 | 6624306 | <reponame>Fernakamuta/machine<filename>statistics/hyphotesis/testing.py
import scipy.stats as st
# Get z-score from p-value (To the left)
print(st.norm.ppf(0.09012267246445244))
# Get p-Value from normal a Z-score (AREA TO THE LEFT)
print(st.norm.cdf(-1.34))
| import scipy.stats as st
# Get z-score from p-value (To the left)
print(st.norm.ppf(0.09012267246445244))
# Get p-Value from normal a Z-score (AREA TO THE LEFT)
print(st.norm.cdf(-1.34)) | en | 0.819507 | # Get z-score from p-value (To the left) # Get p-Value from normal a Z-score (AREA TO THE LEFT) | 2.543419 | 3 |
exercicio 061.py | rayanesousa31/Python-Curso-em-video-Mundo-2 | 0 | 6624307 | <reponame>rayanesousa31/Python-Curso-em-video-Mundo-2<filename>exercicio 061.py
#Refaça o DESAFIO 051,
# lendo o primeiro termo e a razão de uma PA,
# mostrado os 10 primeiros termos da progressão
# usando a estrutura while.
n = int(input('Digite um numero: '))
razao = int(input('Digite uma razao: '))
termo = n
con... | 061.py
#Refaça o DESAFIO 051,
# lendo o primeiro termo e a razão de uma PA,
# mostrado os 10 primeiros termos da progressão
# usando a estrutura while.
n = int(input('Digite um numero: '))
razao = int(input('Digite uma razao: '))
termo = n
cont = 1
while cont <= 10:
print(' {}'.format(termo),end=' ')
termo ... | pt | 0.990197 | #Refaça o DESAFIO 051, # lendo o primeiro termo e a razão de uma PA, # mostrado os 10 primeiros termos da progressão # usando a estrutura while. | 3.843789 | 4 |
src/rocommand/test/TestROSRS_Session.py | A-Mazurek/ro-manager | 11 | 6624308 | #!/usr/bin/env python
"""
Module to test RO SRS APIfunctions
"""
__author__ = "<NAME> (<EMAIL>)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import os, os.path
import sys
import unittest
import logging
import json
import re
import St... | #!/usr/bin/env python
"""
Module to test RO SRS APIfunctions
"""
__author__ = "<NAME> (<EMAIL>)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import os, os.path
import sys
import unittest
import logging
import json
import re
import St... | en | 0.426088 | #!/usr/bin/env python Module to test RO SRS APIfunctions # Add main project directory and ro manager directories at start of python path # Logging object # Base directory for file access tests in this module # Test config details # "http://sandbox.wf4ever-project.org/rodl/ROs/" # Test cases This test suite tests the RO... | 2.211821 | 2 |
docs_src/tutorial/body/tutorial_002.py | dantownsend/xpresso | 75 | 6624309 | from typing import Dict, Optional
from pydantic import BaseModel, Field
from xpresso import App, FromJson, Path
from xpresso.typing import Annotated
class Item(BaseModel):
name: str
price: Annotated[
float,
Field(
gt=0,
description="Item price without tax. Must be gre... | from typing import Dict, Optional
from pydantic import BaseModel, Field
from xpresso import App, FromJson, Path
from xpresso.typing import Annotated
class Item(BaseModel):
name: str
price: Annotated[
float,
Field(
gt=0,
description="Item price without tax. Must be gre... | none | 1 | 2.557941 | 3 | |
tests/integration_tests/IT_test_transformBertTextTokenise.py | elangovana/kegg-pathway-extractor | 10 | 6624310 | import os
from unittest import TestCase
from algorithms.transform_berttext_tokenise import TransformBertTextTokenise
class ITTransformBertTextTokenise(TestCase):
def test___init__(self):
base_model_dir = os.path.join(os.path.dirname(__file__), "..", "temp", "biobert")
assert len(os.listdir(
... | import os
from unittest import TestCase
from algorithms.transform_berttext_tokenise import TransformBertTextTokenise
class ITTransformBertTextTokenise(TestCase):
def test___init__(self):
base_model_dir = os.path.join(os.path.dirname(__file__), "..", "temp", "biobert")
assert len(os.listdir(
... | en | 0.061851 | # Arrange # batch # X # 3 columns # y # batch # x # 3 columns #OT', '##EI', '##N', '##1', '.', 'PR', '##OT', #EI', #N', '##1', 'p', '##hop', '##hor', '##yla', '##tes', 'PR', '##OT', '##EI', '##N', '##2', #OT', '##EI', '##N', '##1', "[SEP]"] #OT', '##EI', '##N', '##2', "[SEP]"] # end of x # Y # batch size 1 # end of bat... | 2.472718 | 2 |
snyk/register.py | aarlaud-snyk/snyk-pants-plugin | 0 | 6624311 | <reponame>aarlaud-snyk/snyk-pants-plugin
from pants.goal.goal import Goal
from pants.goal.task_registrar import TaskRegistrar as task
from snyk.tasks.snyk import SnykTask
from snyk.tasks.dependencies import DependenciesTask
def register_goals():
Goal.register(name="snyktest", description="Snyk Test your dependenci... | from pants.goal.goal import Goal
from pants.goal.task_registrar import TaskRegistrar as task
from snyk.tasks.snyk import SnykTask
from snyk.tasks.dependencies import DependenciesTask
def register_goals():
Goal.register(name="snyktest", description="Snyk Test your dependencies for vulnerabilities")
task(name='d... | none | 1 | 1.894094 | 2 | |
auth.py | EnsembleGetMagic/nft-rater-retweet | 0 | 6624312 | import os
import tweepy
from dotenv import load_dotenv
load_dotenv()
#Load enviroment keys
CONSUMER_KEY = os.getenv('CONSUMER_KEY')
CONSUMER_SECRET = os.getenv('CONSUMER_SECRET')
ACCESS_TOKEN = os.getenv('ACCESS_TOKEN')
ACCESS_SECRET = os.getenv('ACCESS_SECRET')
#Set up api
auth = tweepy.OAuthHandler(CONSUMER_KEY, C... | import os
import tweepy
from dotenv import load_dotenv
load_dotenv()
#Load enviroment keys
CONSUMER_KEY = os.getenv('CONSUMER_KEY')
CONSUMER_SECRET = os.getenv('CONSUMER_SECRET')
ACCESS_TOKEN = os.getenv('ACCESS_TOKEN')
ACCESS_SECRET = os.getenv('ACCESS_SECRET')
#Set up api
auth = tweepy.OAuthHandler(CONSUMER_KEY, C... | en | 0.463028 | #Load enviroment keys #Set up api #Check API | 2.613133 | 3 |
tests/core/test_config_utils.py | ethyca/fides | 153 | 6624313 | <reponame>ethyca/fides<filename>tests/core/test_config_utils.py
# pylint: disable=missing-docstring, redefined-outer-name
import os
from typing import Generator
import pytest
from py._path.local import LocalPath
from toml import dump, load
from fidesctl.core.config import FidesctlConfig
from fidesctl.core.config.util... | # pylint: disable=missing-docstring, redefined-outer-name
import os
from typing import Generator
import pytest
from py._path.local import LocalPath
from toml import dump, load
from fidesctl.core.config import FidesctlConfig
from fidesctl.core.config.utils import update_config_file
@pytest.fixture
def test_change_co... | en | 0.704285 | # pylint: disable=missing-docstring, redefined-outer-name Create a dictionary to be used as an example config file Create an example config.toml and validate both updating an existing config setting and adding a new section and setting. | 2.18516 | 2 |
public/python/setgoals.py | aaronmsimon/nhl94-season-replay | 0 | 6624314 | #!C:/Program Files/Python38/python.exe
import binascii
import csv
# open save file
filename = r'C:\Users\Aaron\AppData\Roaming\RetroArch\states\nhl94_updated.state'
with open(filename,'rb') as inputfile:
content = inputfile.read()
hexFile = binascii.hexlify(content).decode('utf-8')
n = 2
hexes = [(hex... | #!C:/Program Files/Python38/python.exe
import binascii
import csv
# open save file
filename = r'C:\Users\Aaron\AppData\Roaming\RetroArch\states\nhl94_updated.state'
with open(filename,'rb') as inputfile:
content = inputfile.read()
hexFile = binascii.hexlify(content).decode('utf-8')
n = 2
hexes = [(hex... | en | 0.740993 | #!C:/Program Files/Python38/python.exe # open save file # check points # parse scoringsummary # goal scorer # determine team for which set of player stats to update # player stats # check if assist1 is different # check if the original assist was not empty # if not, then reduce the original assist by one # always incre... | 2.725025 | 3 |
VAT/utils.py | vamoscy/DeepLearning2019 | 0 | 6624315 | <filename>VAT/utils.py<gh_stars>0
from collections import OrderedDict
import logging
import logzero
from pathlib import Path
from tensorboardX import SummaryWriter
import torch
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
de... | <filename>VAT/utils.py<gh_stars>0
from collections import OrderedDict
import logging
import logzero
from pathlib import Path
from tensorboardX import SummaryWriter
import torch
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
de... | en | 0.383527 | Computes and stores the average and current value Computes the precision@k for the specified values of k # remove `module.` | 2.264258 | 2 |
stage01/rogue.py | kantel/tkbuchhaim | 0 | 6624316 | import tkinter as tk
import os
root = tk.Tk()
root.title("Rogue Stage 1")
cw, ch = 640, 480
canvas = tk.Canvas(root, width = cw, height = ch, bg = "royalblue")
canvas.grid(row = 0, column = 0)
# Hier wird der Pfad zum Verzeichnis des ».py«-Files gesetzt
# Erspart einem das Herumgehample in TextMate mit dem os.getc... | import tkinter as tk
import os
root = tk.Tk()
root.title("Rogue Stage 1")
cw, ch = 640, 480
canvas = tk.Canvas(root, width = cw, height = ch, bg = "royalblue")
canvas.grid(row = 0, column = 0)
# Hier wird der Pfad zum Verzeichnis des ».py«-Files gesetzt
# Erspart einem das Herumgehample in TextMate mit dem os.getc... | de | 0.993798 | # Hier wird der Pfad zum Verzeichnis des ».py«-Files gesetzt # Erspart einem das Herumgehample in TextMate mit dem os.getcwd() # und os.path.join() | 2.871483 | 3 |
HunterAdminApi/web_app.py | tt9133github/hunter | 322 | 6624317 | <filename>HunterAdminApi/web_app.py
#!/ usr/bin/env
# coding=utf-8
#
# Copyright 2019 ztosec & https://www.zto.com/
#
# 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.o... | <filename>HunterAdminApi/web_app.py
#!/ usr/bin/env
# coding=utf-8
#
# Copyright 2019 ztosec & https://www.zto.com/
#
# 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.o... | en | 0.729797 | #!/ usr/bin/env # coding=utf-8 # # Copyright 2019 ztosec & https://www.zto.com/ # # 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 r... | 1.553249 | 2 |
src/datamgr/metasdk/metadata_client/event/subscriber.py | Chromico/bk-base | 84 | 6624318 | <reponame>Chromico/bk-base<filename>src/datamgr/metasdk/metadata_client/event/subscriber.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础计算平台 available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License... | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础计算平台 available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may o... | en | 0.53726 | # -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础计算平台 available. Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtai... | 1.779035 | 2 |
mvmm_sim/simulation/sim_naming.py | idc9/mvmm_sim | 0 | 6624319 | <filename>mvmm_sim/simulation/sim_naming.py
import names
import numpy as np
import os
def load_all_names():
all_names = []
for gen in ['male', 'female']:
fpath = names.full_path('dist.{}.first'.format(gen))
with open(fpath) as name_file:
for line in name_file:
name,... | <filename>mvmm_sim/simulation/sim_naming.py
import names
import numpy as np
import os
def load_all_names():
all_names = []
for gen in ['male', 'female']:
fpath = names.full_path('dist.{}.first'.format(gen))
with open(fpath) as name_file:
for line in name_file:
name,... | none | 1 | 2.819432 | 3 | |
scripts/sources/s_default_probabilities.py | dpopadic/arpmRes | 6 | 6624320 | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_default_probabilities [<img src="https://www.arpm... | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_default_probabilities [<img src="https://www.arpm... | en | 0.615117 | # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_default_probabilities [<img src="https://www.arpm.... | 2.391799 | 2 |
tools/pvacfuse/net_chop.py | atwollam/pVACtools | 0 | 6624321 | <reponame>atwollam/pVACtools<gh_stars>0
import sys
from lib.net_chop import *
def define_parser():
return NetChop.parser('pvacfuse')
def main(args_input = sys.argv[1:]):
parser = define_parser()
args = parser.parse_args(args_input)
NetChop(args.input_file, args.input_fasta, args.output_file, args.met... | import sys
from lib.net_chop import *
def define_parser():
return NetChop.parser('pvacfuse')
def main(args_input = sys.argv[1:]):
parser = define_parser()
args = parser.parse_args(args_input)
NetChop(args.input_file, args.input_fasta, args.output_file, args.method, args.threshold, 'pVACfuse').execute... | none | 1 | 2.665367 | 3 | |
learning.py | dan840611/Python | 0 | 6624322 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 4 20:55:11 2017
@author: Dan
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
'''
y = np.random.standard_normal(20)
y2 = y * 100
plt.plot(y.cumsum(), 'b', lw = 1.5, label='1st')
plt.plot(y.cumsum(), 'ro')
plt.plo... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 4 20:55:11 2017
@author: Dan
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
'''
y = np.random.standard_normal(20)
y2 = y * 100
plt.plot(y.cumsum(), 'b', lw = 1.5, label='1st')
plt.plot(y.cumsum(), 'ro')
plt.plo... | zh | 0.069251 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Sep 4 20:55:11 2017 @author: Dan y = np.random.standard_normal(20) y2 = y * 100 plt.plot(y.cumsum(), 'b', lw = 1.5, label='1st') plt.plot(y.cumsum(), 'ro') plt.plot(y, 'r', label = '2nd') #參數: tight 所影數據可見;[xmin, xmax, ymin, ymax] plt.axis('tight') plt... | 3.08585 | 3 |
texts/objects/cache/sqlite_ner_cache.py | nicolay-r/frame-based-attitude-extraction-workflow | 0 | 6624323 | from itertools import chain
from os.path import join
from core.processing.lemmatization.base import Stemmer
from core.processing.ner.base import NamedEntityRecognition
from core.processing.ner.obj_decs import NerObjectDescriptor
from texts.extraction.text_parser import terms_utils
from texts.objects.cache.sqlite_base ... | from itertools import chain
from os.path import join
from core.processing.lemmatization.base import Stemmer
from core.processing.ner.base import NamedEntityRecognition
from core.processing.ner.obj_decs import NerObjectDescriptor
from texts.extraction.text_parser import terms_utils
from texts.objects.cache.sqlite_base ... | en | 0.768165 | NOTE: There is a bug in deep_pavlov == 0.11.0 -- returns an invalid data for other elements in batch (>1). With deep_ner it is OK, so the size might be increased which is positively affects on the processing performance # region static fields CREATE TABLE IF NOT EXISTS {table} ( filename TEXT, ... | 2.183004 | 2 |
chatty_back/partners/views.py | always-awake/chatty_back | 0 | 6624324 | <reponame>always-awake/chatty_back<gh_stars>0
from django.utils.decorators import method_decorator
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from chatty_back.diary.views import check_user
def get_partner(... | from django.utils.decorators import method_decorator
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from chatty_back.diary.views import check_user
def get_partner(self, partner_id, creator):
try:
... | ko | 0.999671 | #파트너가 생성된 후, 직전에 생성된 파트너를 함께 일기 쓸 파트너로 선택하기 # Main 화면에 있는 Partner 부분(Main 화면의 module화를 위한 API) | 2.313189 | 2 |
alsek/core/message.py | TariqAHassan/alsek | 1 | 6624325 | """
Message
"""
from __future__ import annotations
from copy import deepcopy
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from uuid import uuid1
from alsek._defaults import DEFAULT_MECHANISM, DEFAULT_QUEUE, DEFAULT_TASK_TIMEOUT
from alsek._utils.printing import auto_repr
from alsek._util... | """
Message
"""
from __future__ import annotations
from copy import deepcopy
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from uuid import uuid1
from alsek._defaults import DEFAULT_MECHANISM, DEFAULT_QUEUE, DEFAULT_TASK_TIMEOUT
from alsek._utils.printing import auto_repr
from alsek._util... | en | 0.753568 | Message Alsek Message. Args: task_name (str): the name of the task for which the message is intended queue (str, optional): the queue for which the message was intended. If ``None`` the default queue will be set. args (list, tuple, optional): positional arguments to ... | 2.314607 | 2 |
tests/callbacks/test_finetuning_callback.py | caillonantoine/pytorch-lightning | 0 | 6624326 | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | en | 0.765446 | # Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i... | 2.217494 | 2 |
airhttprunner/ext/locust/__init__.py | BSTester/httprunner | 0 | 6624327 | import sys
if "locust" in sys.argv[0]:
try:
# monkey patch all at beginning to avoid RecursionError when running locust.
# `from gevent import monkey; monkey.patch_all()` will be triggered when importing locust
from locust import main as locust_main
print("NOTICE: gevent monkey pat... | import sys
if "locust" in sys.argv[0]:
try:
# monkey patch all at beginning to avoid RecursionError when running locust.
# `from gevent import monkey; monkey.patch_all()` will be triggered when importing locust
from locust import main as locust_main
print("NOTICE: gevent monkey pat... | en | 0.64286 | # monkey patch all at beginning to avoid RecursionError when running locust. # `from gevent import monkey; monkey.patch_all()` will be triggered when importing locust Locust is not installed, install first and try again. install with pip: $ pip install locust converted pytest files from YAML/JSON testcases check if a v... | 2.371588 | 2 |
release/scripts/startup/bl_ui/space_view3d_toolbar.py | AFWSI/blender_source_testing | 1 | 6624328 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | en | 0.670043 | # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib... | 1.69388 | 2 |
samsungctl/__init__.py | bolesgb/samsungctl | 0 | 6624329 | <filename>samsungctl/__init__.py
"""Remote control Samsung televisions via TCP/IP connection"""
from .remote import Remote
__title__ = "samsungctl"
__version__ = "0.7.1+1"
__url__ = "https://github.com/bboles/samsungctl"
__author__ = "<NAME> + <NAME>"
__author_email__ = "<EMAIL>"
__license__ = "MIT"
| <filename>samsungctl/__init__.py
"""Remote control Samsung televisions via TCP/IP connection"""
from .remote import Remote
__title__ = "samsungctl"
__version__ = "0.7.1+1"
__url__ = "https://github.com/bboles/samsungctl"
__author__ = "<NAME> + <NAME>"
__author_email__ = "<EMAIL>"
__license__ = "MIT"
| en | 0.546437 | Remote control Samsung televisions via TCP/IP connection | 1.589035 | 2 |
homeassistant/data_entry_flow.py | Natrinicle/home-assistant | 0 | 6624330 | <reponame>Natrinicle/home-assistant
"""Classes to help gather user submissions."""
import logging
import uuid
import voluptuous as vol
from typing import Dict, Any, Callable, Hashable, List, Optional # noqa pylint: disable=unused-import
from .core import callback, HomeAssistant
from .exceptions import HomeAssistantErr... | """Classes to help gather user submissions."""
import logging
import uuid
import voluptuous as vol
from typing import Dict, Any, Callable, Hashable, List, Optional # noqa pylint: disable=unused-import
from .core import callback, HomeAssistant
from .exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__na... | en | 0.834911 | Classes to help gather user submissions. # noqa pylint: disable=unused-import Error while configuring an account. Unknown handler specified. Uknown flow specified. Unknown step specified. Manage all the flows that are in progress. Initialize the flow manager. # type: Dict[str, Any] Return the flows in progress. Start a... | 2.58532 | 3 |
nssrc/com/citrix/netscaler/nitro/resource/config/videooptimization/videooptimizationpacingpolicylabel_binding.py | guardicore/nitro-python | 0 | 6624331 | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | en | 0.78468 | # # Copyright (c) 2021 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or... | 1.820405 | 2 |
jsb/plugs/common/tinyurl.py | NURDspace/jsonbot | 1 | 6624332 | # jsb/plugs/common/tinyurl.py
#
#
""" tinyurl.com feeder """
__author__ = "Wijnand 'tehmaze' Modderman - http://tehmaze.com"
__license__ = 'BSD'
## jsb imports
from jsb.lib.commands import cmnds
from jsb.utils.url import striphtml, useragent
from jsb.lib.examples import examples
from jsb.utils.exception import hand... | # jsb/plugs/common/tinyurl.py
#
#
""" tinyurl.com feeder """
__author__ = "Wijnand 'tehmaze' Modderman - http://tehmaze.com"
__license__ = 'BSD'
## jsb imports
from jsb.lib.commands import cmnds
from jsb.utils.url import striphtml, useragent
from jsb.lib.examples import examples
from jsb.utils.exception import hand... | en | 0.242603 | # jsb/plugs/common/tinyurl.py # # tinyurl.com feeder ## jsb imports ## plug config ## simpljejson ## basic imports ## defines ## functions check if url is valid ## callbacks callback for urlcaching # not enabled right now #callbacks.add('PRIVMSG', privmsgcb, precb) grab a tinyurl. ## tinyurl command arguments: <url> - ... | 2.194623 | 2 |
ee/clickhouse/models/action.py | tmilicic/posthog | 0 | 6624333 | <reponame>tmilicic/posthog
import re
from typing import Dict, List, Tuple
from django.forms.models import model_to_dict
from posthog.constants import AUTOCAPTURE_EVENT, TREND_FILTER_TYPE_ACTIONS
from posthog.models import Action, Entity, Filter
from posthog.models.action_step import ActionStep
from posthog.models.eve... | import re
from typing import Dict, List, Tuple
from django.forms.models import model_to_dict
from posthog.constants import AUTOCAPTURE_EVENT, TREND_FILTER_TYPE_ACTIONS
from posthog.models import Action, Entity, Filter
from posthog.models.action_step import ActionStep
from posthog.models.event import Selector
def fo... | en | 0.801444 | # get action steps # If no steps, it shouldn't match this part of the query # filter element # filter event conditions (ie URL) | 2.045673 | 2 |
Assignment_1/163059009.py | SeeTheC/Machine-Learning | 0 | 6624334 |
# coding: utf-8
# In[3]:
print("Hello bye");
row=list();
ft=open("train.csv");
data=ft.read();
print(data);
# In[10]:
import numpy as np;
from numpy.linalg import inv;
from numpy.linalg import det;
import math;
trainDSSizePercentage=0.7; # x*100 percentage. 1-x data set will be used for validating
# Will read t... |
# coding: utf-8
# In[3]:
print("Hello bye");
row=list();
ft=open("train.csv");
data=ft.read();
print(data);
# In[10]:
import numpy as np;
from numpy.linalg import inv;
from numpy.linalg import det;
import math;
trainDSSizePercentage=0.7; # x*100 percentage. 1-x data set will be used for validating
# Will read t... | en | 0.340087 | # coding: utf-8 # In[3]: # In[10]: # x*100 percentage. 1-x data set will be used for validating # Will read the file and convert it into two dataset one train data other validate data # last row is value of yi #End-readTrainData # Will read the file and convert it into dataset for Testing the Model #End-readTrainData #... | 3.280512 | 3 |
src/mars_profiling/report/structure/variables/render_url.py | wjsi/mars-profiling | 1 | 6624335 | from mars_profiling.config import config
from mars_profiling.report.presentation.core import (
Container,
FrequencyTable,
FrequencyTableSmall,
Table,
VariableInfo,
)
from mars_profiling.report.presentation.frequency_table_utils import freq_table
from mars_profiling.report.structure.variables import ... | from mars_profiling.config import config
from mars_profiling.report.presentation.core import (
Container,
FrequencyTable,
FrequencyTableSmall,
Table,
VariableInfo,
)
from mars_profiling.report.presentation.frequency_table_utils import freq_table
from mars_profiling.report.structure.variables import ... | en | 0.552708 | # Element composition | 2.194871 | 2 |
src/ankidmpy/copier.py | gitonthescene/ankidmpy | 1 | 6624336 | <filename>src/ankidmpy/copier.py
import ankidmpy.util as util
import shutil
import os.path
def copy(deck1, deck2, base):
deck1_path = os.path.join(base, 'decks', util.deckToFilename(deck1))
if not os.path.isdir(deck1_path):
util.err("Source deck not found: %s" % (deck1,))
deck2_suffix = ""
i... | <filename>src/ankidmpy/copier.py
import ankidmpy.util as util
import shutil
import os.path
def copy(deck1, deck2, base):
deck1_path = os.path.join(base, 'decks', util.deckToFilename(deck1))
if not os.path.isdir(deck1_path):
util.err("Source deck not found: %s" % (deck1,))
deck2_suffix = ""
i... | none | 1 | 2.745165 | 3 | |
Concept_Name_Generation/gentaxo.py | DM2-ND/GenTaxo | 2 | 6624337 | import torch
from modules import MSA, BiLSTM, GraphTrans, BiGRU
from utlis import *
from torch import nn
import dgl
class GenTaxo(nn.Module):
def __init__(self, args):
super(GenTaxo, self).__init__()
self.args = args
if args.seq:
self.seq_emb = nn.Embedding(len(args... | import torch
from modules import MSA, BiLSTM, GraphTrans, BiGRU
from utlis import *
from torch import nn
import dgl
class GenTaxo(nn.Module):
def __init__(self, args):
super(GenTaxo, self).__init__()
self.args = args
if args.seq:
self.seq_emb = nn.Embedding(len(args... | en | 0.556119 | # self.seq_enc = BiLSTM(args, enc_type='title') # 0 means the <PAD> # training # copy # greedy # beam search # force ending # B, beam_size, beam_size | 2.370899 | 2 |
LSTM/edit.py | justinhyou/movement-classification-via-CNN-LSTM | 4 | 6624338 | <gh_stars>1-10
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import tensorflow as tf # Version r0.10
from sklearn import metrics
import sklearn
import os
# Useful Constants
# Those are separate normalised input features for the neural network
INPUT_SIGNAL_TYPES = [
"body_acc_x_",
"bo... | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import tensorflow as tf # Version r0.10
from sklearn import metrics
import sklearn
import os
# Useful Constants
# Those are separate normalised input features for the neural network
INPUT_SIGNAL_TYPES = [
"body_acc_x_",
"body_acc_y_",
... | en | 0.811717 | # Version r0.10 # Useful Constants # Those are separate normalised input features for the neural network # Output classes to learn how to classify # Load "X" (the neural network's training and testing inputs) # Read dataset from disk, dealing with text files' syntax # Load "y" (the neural network's training and testing... | 3.113014 | 3 |
Retrofit2Server/retrofit2server/app.py | rakeshcusat/Retrofit2-example | 0 | 6624339 | from flask import Flask
app = Flask(__name__.split('.')[0])
app.debug = True
from retrofit2server.controllers.user import create_user_routes # noqa
# Setup the routes
create_user_routes(app)
| from flask import Flask
app = Flask(__name__.split('.')[0])
app.debug = True
from retrofit2server.controllers.user import create_user_routes # noqa
# Setup the routes
create_user_routes(app)
| en | 0.636427 | # noqa # Setup the routes | 1.868569 | 2 |
topasgraphsim/src/resources/TkinterDnD2/__init__.py | sebasj13/topasgraphsim | 2 | 6624340 | # dnd actions
PRIVATE = 'private'
NONE = 'none'
ASK = 'ask'
COPY = 'copy'
MOVE = 'move'
LINK = 'link'
REFUSE_DROP = 'refuse_drop'
# dnd types
DND_TEXT = 'DND_Text'
DND_FILES = 'DND_Files'
DND_ALL = '*'
CF_UNICODETEXT = 'CF_UNICODETEXT'
CF_TEXT = 'CF_TEXT'
CF_HDROP = 'CF_HDROP'
FileGroupDescriptor = 'FileGroupDescriptor... | # dnd actions
PRIVATE = 'private'
NONE = 'none'
ASK = 'ask'
COPY = 'copy'
MOVE = 'move'
LINK = 'link'
REFUSE_DROP = 'refuse_drop'
# dnd types
DND_TEXT = 'DND_Text'
DND_FILES = 'DND_Files'
DND_ALL = '*'
CF_UNICODETEXT = 'CF_UNICODETEXT'
CF_TEXT = 'CF_TEXT'
CF_HDROP = 'CF_HDROP'
FileGroupDescriptor = 'FileGroupDescriptor... | en | 0.726105 | # dnd actions # dnd types | 1.840055 | 2 |
Python Book/6. Complex Conditions/8_trade_comissions/trade_comissions.py | alexanderivanov2/Softuni-Software-Engineering | 0 | 6624341 | <reponame>alexanderivanov2/Softuni-Software-Engineering<filename>Python Book/6. Complex Conditions/8_trade_comissions/trade_comissions.py
city = input().title()
s = float(input()) #number of sales
comission = 0
error = "error"
if city == "Sofia":
if 0 <= s <= 500:
comission += s * 0.05
elif 500 < s <... | Book/6. Complex Conditions/8_trade_comissions/trade_comissions.py
city = input().title()
s = float(input()) #number of sales
comission = 0
error = "error"
if city == "Sofia":
if 0 <= s <= 500:
comission += s * 0.05
elif 500 < s <= 1000:
comission += s * 0.07
elif 1000 < s <= 10000:
... | en | 0.693578 | #number of sales | 3.746414 | 4 |
email_actions/plugins/exec.py | shantanugoel/fake-email-actions | 37 | 6624342 | <gh_stars>10-100
from subprocess import Popen
import logging
from email_actions.config import read_config_plugin
PLUGIN_NAME = 'exec'
def exec_notify(filter_name, msg_from, msg_to, msg_subject, msg_content):
params = {
'cmd': None,
'args': [],
'env': {
'EA_ENV_MSG_FROM': msg_from,
'EA_ENV_... | from subprocess import Popen
import logging
from email_actions.config import read_config_plugin
PLUGIN_NAME = 'exec'
def exec_notify(filter_name, msg_from, msg_to, msg_subject, msg_content):
params = {
'cmd': None,
'args': [],
'env': {
'EA_ENV_MSG_FROM': msg_from,
'EA_ENV_MSG_TO': msg_to,
... | en | 0.20756 | # Ignore stray env element in config without any actual env param | 2.280437 | 2 |
tests/gis_tests/geoapp/tests.py | lfaraone/python-django-dpkg | 0 | 6624343 | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... | en | 0.791639 | # Ensuring that data was loaded from initial data fixtures. # Testing on a Point # Making sure TypeError is thrown when trying to set with an # incompatible type. # Now setting with a compatible GEOS Geometry, saving, and ensuring # the save took, notice no SRID is explicitly set. # Ensuring that the SRID is automati... | 2.0635 | 2 |
tools/convert_fcos_weight.py | abhishreeshetty/IDL-CrossViz | 0 | 6624344 | import argparse
from collections import OrderedDict
import torch
def get_parser():
parser = argparse.ArgumentParser(description='FCOS Detectron2 Converter')
parser.add_argument(
'--model',
default='weights/fcos_R_50_1x_official.pth',
metavar='FILE',
help='path to model weights... | import argparse
from collections import OrderedDict
import torch
def get_parser():
parser = argparse.ArgumentParser(description='FCOS Detectron2 Converter')
parser.add_argument(
'--model',
default='weights/fcos_R_50_1x_official.pth',
metavar='FILE',
help='path to model weights... | en | 0.776403 | # adding a . ahead to avoid renaming the fpn modules # this can happen after fpn renaming | 2.220082 | 2 |
spacy/en/tokenizer_exceptions.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 1 | 6624345 | <gh_stars>1-10
# coding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
EXC = {}
EXCLUDE_EXC = ["Ill", "ill", "Its", "its", "Hell", "hell", "Shell", "shell",
"Shed", "shed", "were", "Were", "Well", "well", "Whore", "whore"]
# Pronouns
fo... | # coding: utf8
from __future__ import unicode_literals
from ..symbols import *
from ..language_data import PRON_LEMMA
EXC = {}
EXCLUDE_EXC = ["Ill", "ill", "Its", "its", "Hell", "hell", "Shell", "shell",
"Shed", "shed", "were", "Were", "Well", "well", "Whore", "whore"]
# Pronouns
for pron in ["i"]... | en | 0.776783 | # coding: utf8 # Pronouns # W-words, relative pronouns, prepositions etc. # Verbs # Other contractions with trailing apostrophe # Other contractions with leading apostrophe # Times # Rest # Abbreviations # Remove EXCLUDE_EXC if in exceptions # Abbreviations with only one ORTH token | 2.356212 | 2 |
smarts/env/wrappers/frame_stack.py | MCZhi/SMARTS | 2 | 6624346 | <reponame>MCZhi/SMARTS<filename>smarts/env/wrappers/frame_stack.py
# MIT License
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | # MIT License
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 th... | en | 0.699389 | # MIT License # # Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # # 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 th... | 2.182109 | 2 |
microWebSrv.py | youxinweizhi/skill_server_for_esp32 | 10 | 6624347 | <filename>microWebSrv.py
"""
The MIT License (MIT)
Copyright 漏 2018 <NAME> & HC虏 (www.hc2.fr)
"""
from json import loads, dumps
from os import stat
from _thread import start_new_thread
import socket
import gc
import re
try :
from microWebTemplate import MicroWebTemplate
except :
... | <filename>microWebSrv.py
"""
The MIT License (MIT)
Copyright 漏 2018 <NAME> & HC虏 (www.hc2.fr)
"""
from json import loads, dumps
from os import stat
from _thread import start_new_thread
import socket
import gc
import re
try :
from microWebTemplate import MicroWebTemplate
except :
... | en | 0.190156 | The MIT License (MIT) Copyright 漏 2018 <NAME> & HC虏 (www.hc2.fr) # ============================================================================ # ===( Constants )============================================================ # ============================================================================ # ================... | 2.357596 | 2 |
lisp/repl.py | fotcorn/lisp | 0 | 6624348 | <reponame>fotcorn/lisp
import os
import sys
import readline
import atexit
from lisp import interpreter_builtins
from lisp.interpreter_exceptions import InterpreterException
from lisp.lexer import lex, LexerException
from lisp.parser import parse, ParseError
from lisp.interpreter import run, Interpreter
def repl():
... | import os
import sys
import readline
import atexit
from lisp import interpreter_builtins
from lisp.interpreter_exceptions import InterpreterException
from lisp.lexer import lex, LexerException
from lisp.parser import parse, ParseError
from lisp.interpreter import run, Interpreter
def repl():
print("Write 'exit' ... | none | 1 | 2.769726 | 3 | |
reinvent_models/model_factory/generative_model.py | GT4SD/-reinvent_models | 0 | 6624349 | <filename>reinvent_models/model_factory/generative_model.py
from reinvent_models.model_factory.configurations.model_configuration import ModelConfiguration
from reinvent_models.model_factory.enums.model_type_enum import ModelTypeEnum
from reinvent_models.model_factory.generative_model_base import GenerativeModelBase
... | <filename>reinvent_models/model_factory/generative_model.py
from reinvent_models.model_factory.configurations.model_configuration import ModelConfiguration
from reinvent_models.model_factory.enums.model_type_enum import ModelTypeEnum
from reinvent_models.model_factory.generative_model_base import GenerativeModelBase
... | none | 1 | 1.891927 | 2 | |
for_loops_protists.py | julencosme/python-crash-course | 0 | 6624350 | protists_chlorophyta = ['volvox', 'actinastrum', 'hydrodictyon']
for protist in protists_chlorophyta:
print(protist)
for protist in protists_chlorophyta:
print(protist.title() + ", is a protist in the green algae genus.")
print("All of these protists are in the division Chlorophyta, and they are photosynthetic ... | protists_chlorophyta = ['volvox', 'actinastrum', 'hydrodictyon']
for protist in protists_chlorophyta:
print(protist)
for protist in protists_chlorophyta:
print(protist.title() + ", is a protist in the green algae genus.")
print("All of these protists are in the division Chlorophyta, and they are photosynthetic ... | none | 1 | 3.128229 | 3 |