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 |
|---|---|---|---|---|---|---|---|---|---|---|
response_model/python/population_subunits/coarse/analysis/few_cells_tf_analyse_all.py | googlearchive/rgc-models | 1 | 11500 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | en | 0.54245 | # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 1.884795 | 2 |
wagtail/admin/views/pages/unpublish.py | brownaa/wagtail | 8,851 | 11501 | <reponame>brownaa/wagtail<gh_stars>1000+
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import gettext as _
from wagtail.admin import message... | from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import gettext as _
from wagtail.admin import messages
from wagtail.admin.views.pages.utils im... | none | 1 | 1.952083 | 2 | |
bcipy/display/rsvp/display.py | mberkanbicer/BciPy | 32 | 11502 | import logging
import os.path as path
from typing import List, Optional, Tuple
from psychopy import core, visual
from bcipy.acquisition.marker_writer import NullMarkerWriter, MarkerWriter
from bcipy.helpers.task import SPACE_CHAR
from bcipy.helpers.stimuli import resize_image
from bcipy.helpers.system_utils import ge... | import logging
import os.path as path
from typing import List, Optional, Tuple
from psychopy import core, visual
from bcipy.acquisition.marker_writer import NullMarkerWriter, MarkerWriter
from bcipy.helpers.task import SPACE_CHAR
from bcipy.helpers.stimuli import resize_image
from bcipy.helpers.system_utils import ge... | en | 0.522331 | RSVP Display Object for inquiry Presentation. Animates a inquiry in RSVP. Mode should be determined outside. Initialize RSVP window parameters and objects. PARAMETERS: ---------- # Experiment window(visual.Window): PsychoPy Window static_clock(TODO): no idea experim... | 1.925573 | 2 |
cloud/db/db.py | bother3000/Smart-IoT-Planting-System | 171 | 11503 | #!/usr/bin/env python
import pymysql #Python3
db = pymysql.connect("localhost","sips","root","zaijian" )
cursor = db.cursor()
cursor.execute("SELECT VERSION()")
data = cursor.fetchone()
print ("Database version : %s " % data)
db.close()
def create_table():
db = pymysql.connect("localhost","sips","root","zaijian"... | #!/usr/bin/env python
import pymysql #Python3
db = pymysql.connect("localhost","sips","root","zaijian" )
cursor = db.cursor()
cursor.execute("SELECT VERSION()")
data = cursor.fetchone()
print ("Database version : %s " % data)
db.close()
def create_table():
db = pymysql.connect("localhost","sips","root","zaijian"... | en | 0.263674 | #!/usr/bin/env python #Python3 CREATE TABLE EMPLOYEE ( FIRST_NAME CHAR(20) NOT NULL, LAST_NAME CHAR(20), AGE INT, SEX CHAR(1), INCOME FLOAT ) INSERT INTO EMPLOYEE(FIRST_NAME, LAST_NAME, AGE, SEX, INCOME) VALUES ('Mac', 'Mohan', 20, 'M', 2000) | 3.262984 | 3 |
sdk/python/pulumi_aws_native/amplify/_inputs.py | AaronFriel/pulumi-aws-native | 29 | 11504 | <gh_stars>10-100
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. impor... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | en | 0.962837 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** | 1.614374 | 2 |
awsecommerceservice/models/item_lookup_request.py | nidaizamir/Test-PY | 0 | 11505 | # -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemLookupRequest(object):
"""Implementation of the 'ItemLookupRequest' model.
TODO: type model description here.
Attributes:
condition (ConditionE... | # -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemLookupRequest(object):
"""Implementation of the 'ItemLookupRequest' model.
TODO: type model description here.
Attributes:
condition (ConditionE... | en | 0.685522 | # -*- coding: utf-8 -*- awsecommerceservice This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). Implementation of the 'ItemLookupRequest' model. TODO: type model description here. Attributes: condition (ConditionEnum): TODO: type description here. id_type (IdTy... | 2.049022 | 2 |
data.py | zhaoyun630/R-NET-in-Keras | 207 | 11506 | <filename>data.py
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import cPickle as pickle
from keras import backend as K
from keras.utils import np_utils
from keras.preprocessing import sequence
from random import shuffle
import itertoo... | <filename>data.py
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import cPickle as pickle
from keras import backend as K
from keras.utils import np_utils
from keras.preprocessing import sequence
from random import shuffle
import itertoo... | en | 0.465173 | # if self.targets and self.balance: # self.class_weight = class_weight(self.targets) # round up # permutation = np.arange(self.nb_samples) # tmp = permutation.copy() # for id in self.group_ids: # mask = (self.groups==id) # tmp[mask] = np.random.permutation(permutation[mask]) # permutation = tmp # import ipd... | 2.698611 | 3 |
algoritmos/ajuste-curvas/caso-linear/Teste.py | mauriciomoccelin/metodos-numericos | 3 | 11507 | <gh_stars>1-10
from RegressaoLinear import RegressaoLinear
planoCartesiano = {
0.5: 4.4,
2.8: 1.8,
4.2: 1.0,
6.7: 0.4,
8.3: 0.2
}
regressaoLinear = RegressaoLinear(planoCartesiano)
print(regressaoLinear.gerar_equacao())
| from RegressaoLinear import RegressaoLinear
planoCartesiano = {
0.5: 4.4,
2.8: 1.8,
4.2: 1.0,
6.7: 0.4,
8.3: 0.2
}
regressaoLinear = RegressaoLinear(planoCartesiano)
print(regressaoLinear.gerar_equacao()) | none | 1 | 2.264966 | 2 | |
src/app.py | UBC-MDS/dsci_532_group19 | 0 | 11508 | <gh_stars>0
import dash
from dash import html
from dash import dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from .layout import *
from .plot import *
# from layout import *
# from plot import *
app = dash.Dash(
__name__, external_stylesheets=[dbc.themes.BOOTSTRAP, "/css... | import dash
from dash import html
from dash import dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from .layout import *
from .plot import *
# from layout import *
# from plot import *
app = dash.Dash(
__name__, external_stylesheets=[dbc.themes.BOOTSTRAP, "/css/button.css"... | en | 0.636883 | # from layout import * # from plot import * # sidebar, | 2.449235 | 2 |
jaeger-cli/rpc.py | shwsun/jaeger-cli | 0 | 11509 | # Copyright 2018 MassOpenCloud.
#
# 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 agr... | # Copyright 2018 MassOpenCloud.
#
# 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 agr... | en | 0.803307 | # Copyright 2018 MassOpenCloud. # # 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 agr... | 1.308475 | 1 |
data_structure/tree/test_binarytree.py | lp1225/my_algorithm | 1 | 11510 | <reponame>lp1225/my_algorithm
# 搜索二叉树
from queue import Queue
class Node(object):
"""节点"""
def __init__(self, data):
self.data = data
self.node_left = None
self.node_right = None
class BinaryTree(object):
def __init__(self):
self.root = None
def insert(tree, node... | # 搜索二叉树
from queue import Queue
class Node(object):
"""节点"""
def __init__(self, data):
self.data = data
self.node_left = None
self.node_right = None
class BinaryTree(object):
def __init__(self):
self.root = None
def insert(tree, node):
"""插入节点"""
if tree.... | zh | 0.472409 | # 搜索二叉树 节点 插入节点 # 必须要有一个临时节点 先序遍历 中序遍历 后序遍历 得到最大高度k 得到k层的节点 查找最大值 在右子树中找 查找最小值 反转二叉树, 顺序执行,nice # preorder(tree.root) # print() # inorder(tree.root) # print() # get_node(tree.root, 3) # print() # result = get_height(tree.root) # print(result) # max_value = get_max(tree.root) # print(max_value) # min_value... | 4.285847 | 4 |
Python-desenvolvimento/ex036.py | MarcosMaciel-MMRS/Desenvolvimento-python | 0 | 11511 | <gh_stars>0
#empréstimos bancários. pegue o valor da casa, o salario da pessoa e em quanto tempo ela quer pagar.
#se as parcelas ficarem acima de 30% do salario, negue o imprestimo.
casa = float(input('Informe o valor da casa: R$'))
salario = float(input('informe seu salario: R$'))
tempo = int(input('Em quanto te... | #empréstimos bancários. pegue o valor da casa, o salario da pessoa e em quanto tempo ela quer pagar.
#se as parcelas ficarem acima de 30% do salario, negue o imprestimo.
casa = float(input('Informe o valor da casa: R$'))
salario = float(input('informe seu salario: R$'))
tempo = int(input('Em quanto tempo planeja ... | pt | 0.968595 | #empréstimos bancários. pegue o valor da casa, o salario da pessoa e em quanto tempo ela quer pagar. #se as parcelas ficarem acima de 30% do salario, negue o imprestimo. #para fazer a conta com base em anos, levando em conta as parcelas mensais. | 3.891928 | 4 |
UDEMY-Learn Python Programming Masterclass/Section 3-Stepping into the World of Python/exercise4.py | Sanjay9921/Python | 0 | 11512 | #Integer division
#You have a shop selling buns for $2.40 each. A customer comes in with $15, and would like to buy as many buns as possible.
#Complete the code to calculate how many buns the customer can afford.
#Note: Your customer won't be happy if you try to sell them part of a bun.
#Print only the result, any o... | #Integer division
#You have a shop selling buns for $2.40 each. A customer comes in with $15, and would like to buy as many buns as possible.
#Complete the code to calculate how many buns the customer can afford.
#Note: Your customer won't be happy if you try to sell them part of a bun.
#Print only the result, any o... | en | 0.967805 | #Integer division #You have a shop selling buns for $2.40 each. A customer comes in with $15, and would like to buy as many buns as possible. #Complete the code to calculate how many buns the customer can afford. #Note: Your customer won't be happy if you try to sell them part of a bun. #Print only the result, any oth... | 3.974043 | 4 |
scripts/test_maths.py | paulscottrobson/Basic65816 | 0 | 11513 | # *******************************************************************************************
# *******************************************************************************************
#
# Name : test_maths.py
# Purpose : Create lots of variables/arrays and arithmetic/bitwise.
# Date : 10th June 2019
# Author... | # *******************************************************************************************
# *******************************************************************************************
#
# Name : test_maths.py
# Purpose : Create lots of variables/arrays and arithmetic/bitwise.
# Date : 10th June 2019
# Author... | en | 0.290589 | # ******************************************************************************************* # ******************************************************************************************* # # Name : test_maths.py # Purpose : Create lots of variables/arrays and arithmetic/bitwise. # Date : 10th June 2019 # Author... | 3.248458 | 3 |
qa/char_analyze.py | JinkelaCrops/t2t-learning | 5 | 11514 | <gh_stars>1-10
# 所有的unicode字符
from collections import Counter
import qa.regex_utils as regutil
import re
resource_path = "/media/tmxmall/a36811aa-0e87-4ba1-b14f-370134452449/data/medicine.txt"
with open(resource_path, "r", encoding="utf8") as f:
char_stream = f.read()
char_dictionary = Counter(list(char_stream))... | # 所有的unicode字符
from collections import Counter
import qa.regex_utils as regutil
import re
resource_path = "/media/tmxmall/a36811aa-0e87-4ba1-b14f-370134452449/data/medicine.txt"
with open(resource_path, "r", encoding="utf8") as f:
char_stream = f.read()
char_dictionary = Counter(list(char_stream))
med_unicodes =... | zh | 0.402397 | # 所有的unicode字符 [\u0020-\u007e] 13056272 \\u0020-\\u007e Latin [\u00a0-\u00ff] 258619 \\u00a0-\\u00ff Latin ++ [\u0100-\u01ff] 353 \\u0100-\\u01ff Latin ++ [\u0251] 302 \\u0251 ɑ [\u025b] 2 ... | 2.704657 | 3 |
challenges/largest_product_array/test_largest_product.py | jayadams011/data-structures-and-algorithms | 0 | 11515 | from largest_product.py import largest_product
import pytest
def test_product_returns():
"""test if return is a single product """
assert largest_product.largest([[2, 2]]) is 4
def test_returns_largest():
""" test if return is the largest of longer array """
assert largest_product.largest([[1, 3], [6... | from largest_product.py import largest_product
import pytest
def test_product_returns():
"""test if return is a single product """
assert largest_product.largest([[2, 2]]) is 4
def test_returns_largest():
""" test if return is the largest of longer array """
assert largest_product.largest([[1, 3], [6... | en | 0.438505 | test if return is a single product test if return is the largest of longer array test if returns msg if empty list test for one value | 2.860941 | 3 |
examples/transformer/model.py | namin/dm-haiku | 0 | 11516 | # Copyright 2020 DeepMind Technologies Limited. 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 ... | # Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | en | 0.786754 | # Copyright 2020 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ... | 2.254156 | 2 |
face.py | shwang95/Intelligence-Surveillance-System | 1 | 11517 | #!/usr/bin/env python
import boto3
import cv2
import numpy
import os
import base64
import gspread
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from httplib2 import Http
from time import localtime, strftim... | #!/usr/bin/env python
import boto3
import cv2
import numpy
import os
import base64
import gspread
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from httplib2 import Http
from time import localtime, strftim... | en | 0.77599 | #!/usr/bin/env python Require for face comparision Upload the Alert time to the google drive sheet Send the mime email package Create the email Included information: Sender, Receiver, Subject, Text, Attached Image Using oauth2 to get the credentials. It will give all permission related to gmail. client_secr... | 2.192537 | 2 |
unpythonic/syntax/autoref.py | aisha-w/unpythonic | 0 | 11518 | # -*- coding: utf-8 -*-
"""Implicitly reference attributes of an object."""
from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, \
Attribute, Subscript, Store, Del
from macropy.core.quotes import macros, q, u, name, ast_literal
from macropy.core.hquotes import macros, hq
from macropy.core... | # -*- coding: utf-8 -*-
"""Implicitly reference attributes of an object."""
from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, \
Attribute, Subscript, Store, Del
from macropy.core.quotes import macros, q, u, name, ast_literal
from macropy.core.hquotes import macros, hq
from macropy.core... | en | 0.500704 | # -*- coding: utf-8 -*- Implicitly reference attributes of an object. # with autoref(o): # with autoref(scipy.loadmat("mydata.mat")): # evaluate once, assign to a gensym # with autoref(scipy.loadmat("mydata.mat")) as o: # evaluate once, assign to given name # # We need something like:: # # with autoref(o): # ... | 2.395967 | 2 |
doit/exceptions.py | m4ta1l/doit | 1,390 | 11519 | <reponame>m4ta1l/doit
"""Handle exceptions generated from 'user' code"""
import sys
import traceback
class InvalidCommand(Exception):
"""Invalid command line argument."""
def __init__(self, *args, **kwargs):
self.not_found = kwargs.pop('not_found', None)
super(InvalidCommand, self).__init__(*... | """Handle exceptions generated from 'user' code"""
import sys
import traceback
class InvalidCommand(Exception):
"""Invalid command line argument."""
def __init__(self, *args, **kwargs):
self.not_found = kwargs.pop('not_found', None)
super(InvalidCommand, self).__init__(*args, **kwargs)
... | en | 0.828234 | Handle exceptions generated from 'user' code Invalid command line argument. # default but might be overwriten Invalid dodo file Invalid task instance. User error on specifying the task. This used to save info from caught exceptions The traceback from the original exception is saved # TODO remove doit-code part from... | 3.479694 | 3 |
python/redmonster/tools/plot_fits.py | timahutchinson/redmonster | 5 | 11520 | <reponame>timahutchinson/redmonster
# GUI used for quickly plotting BOSS spectra. Also allows overplotting of best-fit template as
# determined by redmonster pipeline. Sort of a redmonster version of plotspec.pro, though currently
# with less bells and whistles.
#
# <NAME>, University of Utah, April 2014
# Signifcant... | # GUI used for quickly plotting BOSS spectra. Also allows overplotting of best-fit template as
# determined by redmonster pipeline. Sort of a redmonster version of plotspec.pro, though currently
# with less bells and whistles.
#
# <NAME>, University of Utah, April 2014
# Signifcantly updated by TH, October 2014
#
# <... | en | 0.847129 | # GUI used for quickly plotting BOSS spectra. Also allows overplotting of best-fit template as # determined by redmonster pipeline. Sort of a redmonster version of plotspec.pro, though currently # with less bells and whistles. # # <NAME>, University of Utah, April 2014 # Signifcantly updated by TH, October 2014 # # <... | 2.087522 | 2 |
QueueReconstruction.py | yashpatel0369/PythonDataStructures | 0 | 11521 | <filename>QueueReconstruction.py
# An algorithm to reconstruct the queue.
# Suppose you have a random list of people standing in a queue.
# Each person is described by a pair of integers (h,k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or eq... | <filename>QueueReconstruction.py
# An algorithm to reconstruct the queue.
# Suppose you have a random list of people standing in a queue.
# Each person is described by a pair of integers (h,k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or eq... | en | 0.963283 | # An algorithm to reconstruct the queue. # Suppose you have a random list of people standing in a queue. # Each person is described by a pair of integers (h,k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. | 3.999021 | 4 |
passagens/models/classe_viagem.py | carlosrjhoe/Aplicacao_Formulario_com_Django | 0 | 11522 | <reponame>carlosrjhoe/Aplicacao_Formulario_com_Django<gh_stars>0
from django.db import models
from django.utils.translation import gettext_lazy as _
class ClasseViagem(models.TextChoices):
ECONOMICA = 'ECO', _('Econômica')
EXECUTIVA = 'EXE', _('Executiva')
PRIMEIRA_CLASSE = 'PRI', _('Primeira') | from django.db import models
from django.utils.translation import gettext_lazy as _
class ClasseViagem(models.TextChoices):
ECONOMICA = 'ECO', _('Econômica')
EXECUTIVA = 'EXE', _('Executiva')
PRIMEIRA_CLASSE = 'PRI', _('Primeira') | none | 1 | 1.935433 | 2 | |
tests/unit/test_HashlistsByAlgLoaderThread.py | AntonKuzminRussia/hbs-cli | 5 | 11523 | # -*- coding: utf-8 -*-
"""
This is part of HashBruteStation software
Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en
Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station
License: MIT
Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Integration tests for Has... | # -*- coding: utf-8 -*-
"""
This is part of HashBruteStation software
Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en
Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station
License: MIT
Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Integration tests for Has... | en | 0.277536 | # -*- coding: utf-8 -*- This is part of HashBruteStation software Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station License: MIT Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Integration tests for Hashlis... | 2.257235 | 2 |
simple_ddl_parser/tokens.py | burakuyar/simple-ddl-parser | 46 | 11524 | # statements that used at the start of defenition or in statements without columns
defenition_statements = {
"DROP": "DROP",
"CREATE": "CREATE",
"TABLE": "TABLE",
"DATABASE": "DATABASE",
"SCHEMA": "SCHEMA",
"ALTER": "ALTER",
"TYPE": "TYPE",
"DOMAIN": "DOMAIN",
"REPLACE": "REPLACE",
... | # statements that used at the start of defenition or in statements without columns
defenition_statements = {
"DROP": "DROP",
"CREATE": "CREATE",
"TABLE": "TABLE",
"DATABASE": "DATABASE",
"SCHEMA": "SCHEMA",
"ALTER": "ALTER",
"TYPE": "TYPE",
"DOMAIN": "DOMAIN",
"REPLACE": "REPLACE",
... | en | 0.74819 | # statements that used at the start of defenition or in statements without columns # bigquery # hql # oracle # mssql | 2.220004 | 2 |
rmexp/worker.py | junjuew/scalable-edge-native-applications | 1 | 11525 | from __future__ import absolute_import, division, print_function
import json
import logging
import os
import time
import importlib
import multiprocessing
import cv2
import fire
import logzero
from logzero import logger
import numpy as np
from rmexp import config, cvutils, dbutils, gabriel_pb2, client
from rmexp.sche... | from __future__ import absolute_import, division, print_function
import json
import logging
import os
import time
import importlib
import multiprocessing
import cv2
import fire
import logzero
from logzero import logger
import numpy as np
from rmexp import config, cvutils, dbutils, gabriel_pb2, client
from rmexp.sche... | en | 0.495502 | [summary] Arguments: job_queue {[type]} -- [description] app {[type]} -- [description] Keyword Arguments: busy_wait {float} -- if not None, busy spin seconds instead of running actual app (default: {None}) # do real work # busy wait fixed time A Class to sample video stream. Designed t... | 2.189431 | 2 |
app/requests/users.py | codingedward/book-a-meal-api | 0 | 11526 | from .base import JsonRequest
class PostRequest(JsonRequest):
@staticmethod
def rules():
return {
'email': 'required|email|unique:User,email',
'password': '<PASSWORD>',
'username': 'required|alpha|least_string:3',
'role': 'integer|positive|found_in:1,2',... | from .base import JsonRequest
class PostRequest(JsonRequest):
@staticmethod
def rules():
return {
'email': 'required|email|unique:User,email',
'password': '<PASSWORD>',
'username': 'required|alpha|least_string:3',
'role': 'integer|positive|found_in:1,2',... | none | 1 | 2.574099 | 3 | |
kmp.py | mutux/kmp | 3 | 11527 | <gh_stars>1-10
def kmp(P, T):
# Compute the start position (number of chars) of the longest suffix that matches a prefix,
# and store them into list K, the first element of K is set to be -1, the second
#
K = [] # K[t] store the value that when mismatch happens at t, should move Pattern P K[t] characte... | def kmp(P, T):
# Compute the start position (number of chars) of the longest suffix that matches a prefix,
# and store them into list K, the first element of K is set to be -1, the second
#
K = [] # K[t] store the value that when mismatch happens at t, should move Pattern P K[t] characters ahead
t ... | en | 0.84877 | # Compute the start position (number of chars) of the longest suffix that matches a prefix, # and store them into list K, the first element of K is set to be -1, the second # # K[t] store the value that when mismatch happens at t, should move Pattern P K[t] characters ahead # K's length is len(P) + 1, the first element... | 3.654146 | 4 |
weeklypedia/publish.py | Nintendofan885/weeklypedia | 0 | 11528 | <reponame>Nintendofan885/weeklypedia<filename>weeklypedia/publish.py
# -*- coding: utf-8 -*-
import os
import json
from os.path import dirname
from argparse import ArgumentParser
from clastic.render import AshesRenderFactory
from common import DEBUG, DEBUG_LIST_ID, SENDKEY
from web import (comma_int,
... | # -*- coding: utf-8 -*-
import os
import json
from os.path import dirname
from argparse import ArgumentParser
from clastic.render import AshesRenderFactory
from common import DEBUG, DEBUG_LIST_ID, SENDKEY
from web import (comma_int,
ISSUE_TEMPLATES_PATH)
from bake import (Issue,
b... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.958676 | 2 |
scripts/words_gen.py | andybui01/Bloom | 0 | 11529 | import random
import sys
# usage: python3 words_gen.py > list.txt
N = int(sys.argv[1]) # how many words should be in the resulting list
with open("scripts/words.txt", "r") as f:
words = f.readlines()
for i in range(N):
print(words[random.randint(0, 466550 - 1)].rstrip())
| import random
import sys
# usage: python3 words_gen.py > list.txt
N = int(sys.argv[1]) # how many words should be in the resulting list
with open("scripts/words.txt", "r") as f:
words = f.readlines()
for i in range(N):
print(words[random.randint(0, 466550 - 1)].rstrip())
| en | 0.851551 | # usage: python3 words_gen.py > list.txt # how many words should be in the resulting list | 3.326956 | 3 |
testing/test_input.py | arunumd/Rover | 1 | 11530 | import unittest
from modules.Input import *
class CommandInputTest(unittest.TestCase):
def setUp(self):
self.field_a_locations = ["gOtOFieldAroW8",
" go to fieLDA RoW 18 ",
"gOTOfield A rOW88"]
self.field_b_locations = ["gOtOFie... | import unittest
from modules.Input import *
class CommandInputTest(unittest.TestCase):
def setUp(self):
self.field_a_locations = ["gOtOFieldAroW8",
" go to fieLDA RoW 18 ",
"gOTOfield A rOW88"]
self.field_b_locations = ["gOtOFie... | none | 1 | 3.629783 | 4 | |
rmgpy/kinetics/chebyshevTest.py | pm15ma/RMG-Py | 1 | 11531 | <gh_stars>1-10
#!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | en | 0.691333 | #!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ... | 1.56623 | 2 |
SceneDistribution_Blender/Source/__init__.py | FilmakademieRnd/v-p-e-t | 62 | 11532 | """
-----------------------------------------------------------------------------
This source file is part of VPET - Virtual Production Editing Tools
http://vpet.research.animationsinstitut.de/
http://github.com/FilmakademieRnd/VPET
Copyright (c) 2021 <NAME>, Animationsinstitut R&D Lab
This project has been initiated... | """
-----------------------------------------------------------------------------
This source file is part of VPET - Virtual Production Editing Tools
http://vpet.research.animationsinstitut.de/
http://github.com/FilmakademieRnd/VPET
Copyright (c) 2021 <NAME>, Animationsinstitut R&D Lab
This project has been initiated... | en | 0.788436 | ----------------------------------------------------------------------------- This source file is part of VPET - Virtual Production Editing Tools http://vpet.research.animationsinstitut.de/ http://github.com/FilmakademieRnd/VPET Copyright (c) 2021 <NAME>, Animationsinstitut R&D Lab This project has been initiated in ... | 1.149031 | 1 |
defences/CIFAR10/standard_training.py | calinbiberea/imperial-individual-project | 0 | 11533 | # Unlike the other datasets, CIFAR-10 uses ResNet and suffers from
# a variety of problems, including exploding gradients
import torch
import torch.nn as nn
from tqdm.notebook import tnrange, tqdm
# For loading model sanely
import os.path
import sys
# This here actually adds the path
sys.path.append("../../")
import ... | # Unlike the other datasets, CIFAR-10 uses ResNet and suffers from
# a variety of problems, including exploding gradients
import torch
import torch.nn as nn
from tqdm.notebook import tnrange, tqdm
# For loading model sanely
import os.path
import sys
# This here actually adds the path
sys.path.append("../../")
import ... | en | 0.867831 | # Unlike the other datasets, CIFAR-10 uses ResNet and suffers from # a variety of problems, including exploding gradients # For loading model sanely # This here actually adds the path # Define the `device` PyTorch will be running on, please hope it is CUDA # Helps adjust learning rate for better results # This method c... | 2.81626 | 3 |
src/romt/manifest.py | hehaoqian/romt | 29 | 11534 | <reponame>hehaoqian/romt<filename>src/romt/manifest.py
#!/usr/bin/env python3
# coding=utf-8
import copy
from pathlib import Path
from typing import (
Any,
Generator,
Iterable,
List,
MutableMapping,
Optional,
)
import toml
from romt import error
def target_matches_any(target: str, expected_... | #!/usr/bin/env python3
# coding=utf-8
import copy
from pathlib import Path
from typing import (
Any,
Generator,
Iterable,
List,
MutableMapping,
Optional,
)
import toml
from romt import error
def target_matches_any(target: str, expected_targets: Iterable[str]) -> bool:
if target == "*":
... | en | 0.699171 | #!/usr/bin/env python3 # coding=utf-8 # Sample version lines found below [pkg.rust-src]: # version = "1.43.0-beta.5 (934ae7739 2020-04-06)" # version = "1.44.0-nightly (42abbd887 2020-04-07)" # version = "1.42.0 (b8cedc004 2020-03-09)" # version = "1.44.0-nightly (42abbd887 2020-04-07)" # version = "1.42.0 (b8cedc004 2... | 2.263743 | 2 |
examples/unread_sms.py | MikeRixWolfe/pygooglevoice | 1 | 11535 | <reponame>MikeRixWolfe/pygooglevoice
from googlevoice import Voice
voice = Voice()
voice.login()
for message in voice.sms().messages:
#if not message.isRead:
print(message.id, message.phoneNumber, message.messageText)
#message.mark(1)
| from googlevoice import Voice
voice = Voice()
voice.login()
for message in voice.sms().messages:
#if not message.isRead:
print(message.id, message.phoneNumber, message.messageText)
#message.mark(1) | tr | 0.093105 | #if not message.isRead: #message.mark(1) | 2.720474 | 3 |
libra/handlers/user.py | pitomba/libra | 2 | 11536 | # coding: utf-8
from tornado.web import RequestHandler
from libra.handlers.base import authenticated
class UserHandler(RequestHandler):
@authenticated
def post(self, user, **kwargs):
self.write({"msg": "Success"})
| # coding: utf-8
from tornado.web import RequestHandler
from libra.handlers.base import authenticated
class UserHandler(RequestHandler):
@authenticated
def post(self, user, **kwargs):
self.write({"msg": "Success"})
| en | 0.833554 | # coding: utf-8 | 2.071905 | 2 |
plextraktsync/commands/unmatched.py | RoyXiang/PlexTraktSync | 0 | 11537 | <filename>plextraktsync/commands/unmatched.py
import click
from plextraktsync.commands.login import ensure_login
from plextraktsync.factory import factory
from plextraktsync.walker import WalkConfig, Walker
def unmatched(no_progress_bar: bool, local: bool):
config = factory.run_config().update(progressbar=not no... | <filename>plextraktsync/commands/unmatched.py
import click
from plextraktsync.commands.login import ensure_login
from plextraktsync.factory import factory
from plextraktsync.walker import WalkConfig, Walker
def unmatched(no_progress_bar: bool, local: bool):
config = factory.run_config().update(progressbar=not no... | none | 1 | 2.600919 | 3 | |
montepython/likelihoods/covfefe/__init__.py | Maquiner/Monte_Python_2CCL | 1 | 11538 | import os
import numpy as np
from montepython.likelihood_class import Likelihood
import montepython.io_mp as io_mp
import warnings
import ccl_tools as tools
import pyccl as ccl
class covfefe(Likelihood):
# initialization routine
def __init__(self, path, data, command_line):
Likelihood.__init__(sel... | import os
import numpy as np
from montepython.likelihood_class import Likelihood
import montepython.io_mp as io_mp
import warnings
import ccl_tools as tools
import pyccl as ccl
class covfefe(Likelihood):
# initialization routine
def __init__(self, path, data, command_line):
Likelihood.__init__(sel... | en | 0.562343 | # initialization routine # Load Covariance matrix # Load ell bandpowers # Load photo_z # Load data # end of initialization # compute likelihood # Get theory Cls # Get chi2 | 2.179705 | 2 |
tests/integration/web3/conftest.py | cducrest/eth-tester-rpc | 3 | 11539 | <filename>tests/integration/web3/conftest.py
from eth_utils import (
to_bytes,
)
from eth_utils.toolz import (
identity,
)
import pytest
from web3._utils.module_testing.emitter_contract import (
CONTRACT_EMITTER_ABI,
CONTRACT_EMITTER_CODE,
)
from web3._utils.module_testing.math_contract import (
MAT... | <filename>tests/integration/web3/conftest.py
from eth_utils import (
to_bytes,
)
from eth_utils.toolz import (
identity,
)
import pytest
from web3._utils.module_testing.emitter_contract import (
CONTRACT_EMITTER_ABI,
CONTRACT_EMITTER_CODE,
)
from web3._utils.module_testing.math_contract import (
MAT... | none | 1 | 1.623256 | 2 | |
planning/domains/depth/depthGenerator.py | xlbandy/fape | 14 | 11540 | from __future__ import division
import itertools
import json
import math
import os
import random
import shutil
import subprocess
import sys
durationA = str(5)
durationB = str(4)
durationC = str(1)
def main():
if len(sys.argv) > 1:
nbDepth = int(sys.argv[1])
if nbDepth < 2 :
nbDept... | from __future__ import division
import itertools
import json
import math
import os
import random
import shutil
import subprocess
import sys
durationA = str(5)
durationB = str(4)
durationC = str(1)
def main():
if len(sys.argv) > 1:
nbDepth = int(sys.argv[1])
if nbDepth < 2 :
nbDept... | de | 0.553609 | #print "Every file has been written. Exiting" ######################## problem ############### #################### problem ############# | 2.434349 | 2 |
idc/settings.py | fedorov/IDC-WebApp | 0 | 11541 | ###
# Copyright 2015-2020, Institute for Systems Biology
#
# 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 la... | ###
# Copyright 2015-2020, Institute for Systems Biology
#
# 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 la... | en | 0.609335 | ### # Copyright 2015-2020, Institute for Systems Biology # # 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 la... | 1.977638 | 2 |
examples/fixed_play.py | wwxFromTju/malib | 6 | 11542 | <gh_stars>1-10
# Created by yingwen at 2019-03-16
from multiprocessing import Process
from malib.agents.agent_factory import *
from malib.environments import DifferentialGame
from malib.logger.utils import set_logger
from malib.samplers.sampler import MASampler
from malib.trainers import MATrainer
from malib.utils.ran... | # Created by yingwen at 2019-03-16
from multiprocessing import Process
from malib.agents.agent_factory import *
from malib.environments import DifferentialGame
from malib.logger.utils import set_logger
from malib.samplers.sampler import MASampler
from malib.trainers import MATrainer
from malib.utils.random import set_... | en | 0.94654 | # Created by yingwen at 2019-03-16 # # # Awkward hacky process runs, because Tensorflow does not like | 2.021163 | 2 |
hypha/apply/projects/templatetags/payment_request_tools.py | maxpearl/hypha | 16 | 11543 | import decimal
from django import template
register = template.Library()
@register.simple_tag
def can_change_status(payment_request, user):
return payment_request.can_user_change_status(user)
@register.simple_tag
def can_delete(payment_request, user):
return payment_request.can_user_delete(user)
@regist... | import decimal
from django import template
register = template.Library()
@register.simple_tag
def can_change_status(payment_request, user):
return payment_request.can_user_change_status(user)
@register.simple_tag
def can_delete(payment_request, user):
return payment_request.can_user_delete(user)
@regist... | en | 0.883024 | # round using Decimal since we're dealing with currency | 2.382467 | 2 |
pylabnet/hardware/counter/swabian_instruments/qudi/slow_ctr.py | wi11dey/pylabnet | 10 | 11544 | """ pylabnet measurement and service classes for Swabian Instruments TimeTagger
which implements qudi's SlowCounter interface.
This file contains pylabnet wrapper and service classes to allow qudi to
access Swabian Instruments TT through pylabnet network as SlowCounter.
Steps:
- instantiate TimeTagger
- instantiate p... | """ pylabnet measurement and service classes for Swabian Instruments TimeTagger
which implements qudi's SlowCounter interface.
This file contains pylabnet wrapper and service classes to allow qudi to
access Swabian Instruments TT through pylabnet network as SlowCounter.
Steps:
- instantiate TimeTagger
- instantiate p... | en | 0.760446 | pylabnet measurement and service classes for Swabian Instruments TimeTagger which implements qudi's SlowCounter interface. This file contains pylabnet wrapper and service classes to allow qudi to access Swabian Instruments TT through pylabnet network as SlowCounter. Steps: - instantiate TimeTagger - instantiate pylab... | 2.24606 | 2 |
dev0s/classes/defaults/files.py | vandenberghinc/dev0s | 1 | 11545 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Must still be recoded with some cleaner code.
"""
# imports.
from dev0s.classes.config import *
from dev0s.classes import utils
from dev0s.classes.defaults.color import color, symbol
from dev0s.classes import console
from dev0s.classes.defaults.exceptions import Excep... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Must still be recoded with some cleaner code.
"""
# imports.
from dev0s.classes.config import *
from dev0s.classes import utils
from dev0s.classes.defaults.color import color, symbol
from dev0s.classes import console
from dev0s.classes.defaults.exceptions import Excep... | en | 0.671974 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Must still be recoded with some cleaner code. # imports. # pip. Notes. All default files & formats must exact the same as the default dict, bool, list etc in the native sense. There are lots additionals though. But a dict and Dictionary should be able to be used universall... | 2.675562 | 3 |
object_torus.py | KeerthanBhat/pygame-Search-the-Key | 0 | 11546 | import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def main():
pygame.init()
glutInit()
display = (800,600)
pygame.display.set_mode(display, DOUBLEBUF|OPENGL)
gluPerspective(45, (display[0]/display[1]), 0.1, 50.0)
glTranslatef(0.0, 0.0, -5)
w... | import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def main():
pygame.init()
glutInit()
display = (800,600)
pygame.display.set_mode(display, DOUBLEBUF|OPENGL)
gluPerspective(45, (display[0]/display[1]), 0.1, 50.0)
glTranslatef(0.0, 0.0, -5)
w... | none | 1 | 3.002471 | 3 | |
samples/snippets/translate_v3_batch_translate_text_with_glossary_and_model.py | renovate-bot/python-translate | 70 | 11547 | <gh_stars>10-100
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | en | 0.76908 | # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 2.204335 | 2 |
movo_common/movo_third_party/executive_smach/smach_ros/test/concurrence.py | zkytony/kinova-movo | 2 | 11548 | <filename>movo_common/movo_third_party/executive_smach/smach_ros/test/concurrence.py
#!/usr/bin/env python
import roslib; roslib.load_manifest('smach_ros')
import rospy
import rostest
import unittest
from actionlib import *
from actionlib.msg import *
from smach import *
from smach_ros import *
from smach_msgs.msg... | <filename>movo_common/movo_third_party/executive_smach/smach_ros/test/concurrence.py
#!/usr/bin/env python
import roslib; roslib.load_manifest('smach_ros')
import rospy
import rostest
import unittest
from actionlib import *
from actionlib.msg import *
from smach import *
from smach_ros import *
from smach_msgs.msg... | en | 0.855945 | #!/usr/bin/env python # Static goals # This goal should succeed # This goal should abort # This goal should be rejected ### Custom tate classe State that sets the key 'a' in its userdata State that grabs the key 'a' from userdata, and sets 'b' ### Test harness Test concurrent container. Test concurrent container that p... | 1.913821 | 2 |
KaratAPP/models.py | MHuiG/Karat-Django-Backend | 0 | 11549 | from django.db import models
# Create your models here.
##########################################################################
#投票
class Vote(models.Model):
data=models.CharField(max_length=255)
########################################################################## | from django.db import models
# Create your models here.
##########################################################################
#投票
class Vote(models.Model):
data=models.CharField(max_length=255)
########################################################################## | de | 0.801891 | # Create your models here. ########################################################################## #投票 ########################################################################## | 2.418271 | 2 |
arguments.py | nudles/a2c | 0 | 11550 | import argparse
import torch
def get_args():
parser = argparse.ArgumentParser(description='RL')
parser.add_argument('--algo', default='a2c',
help='algorithm to use: a2c | ppo ')
parser.add_argument('--lr', type=float, default=7e-5,
help='learning rate (defau... | import argparse
import torch
def get_args():
parser = argparse.ArgumentParser(description='RL')
parser.add_argument('--algo', default='a2c',
help='algorithm to use: a2c | ppo ')
parser.add_argument('--lr', type=float, default=7e-5,
help='learning rate (defau... | none | 1 | 2.470109 | 2 | |
vega/algorithms/nas/__init__.py | wnov/vega | 6 | 11551 | from .backbone_nas import *
from .adelaide_ea import *
from .sr_ea import *
from .esr_ea import *
from .darts_cnn import *
from .cars import *
from .fis import *
from .auto_lane import *
from .mfkd import *
| from .backbone_nas import *
from .adelaide_ea import *
from .sr_ea import *
from .esr_ea import *
from .darts_cnn import *
from .cars import *
from .fis import *
from .auto_lane import *
from .mfkd import *
| none | 1 | 1.003068 | 1 | |
ai.py | s18mbbustorff/AI_Hanabi_Assignment | 0 | 11552 | <filename>ai.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 9 12:27:15 2021
@author: kuba
"""
import copy
import numpy as np
w = {"H0": {"H0":0.2,"H1": 0.2, "P0": 0.5, "P1": 0.1},
"H1": {"H0":0.2,"H1": 0.2, "P0": 0.1, "P1": 0.5},
"P0": {"H0":0.3,"H1": 0.3, "P0": 0.2, "P1": 0.2},... | <filename>ai.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 9 12:27:15 2021
@author: kuba
"""
import copy
import numpy as np
w = {"H0": {"H0":0.2,"H1": 0.2, "P0": 0.5, "P1": 0.1},
"H1": {"H0":0.2,"H1": 0.2, "P0": 0.1, "P1": 0.5},
"P0": {"H0":0.3,"H1": 0.3, "P0": 0.2, "P1": 0.2},... | en | 0.788693 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Tue Mar 9 12:27:15 2021 @author: kuba #player that has the turn, either 1 or 2 (int) #list of cards in player one's hand (Card list) 2cards that need to be created with the Card object #list of cards in AI 's hand (Card list) 2cards that need to be created wit... | 3.307173 | 3 |
(19.12.06) Culminating/sprites.py | bly852/ICS3U1 | 0 | 11553 | # course: ICS3U1 2019
# exercise: Culminating Activity
# date: 2019-12-06
# student number: 340926187
# name: <NAME>
# description: Two players (Mr Chun & Mr Pileggi) running around the school
# collecting food for the food drive.
# sprite classes
import pygame
imp... | # course: ICS3U1 2019
# exercise: Culminating Activity
# date: 2019-12-06
# student number: 340926187
# name: <NAME>
# description: Two players (Mr Chun & Mr Pileggi) running around the school
# collecting food for the food drive.
# sprite classes
import pygame
imp... | en | 0.887479 | # course: ICS3U1 2019 # exercise: Culminating Activity # date: 2019-12-06 # student number: 340926187 # name: <NAME> # description: Two players (Mr Chun & Mr Pileggi) running around the school # collecting food for the food drive. # sprite classes player class that c... | 3.631374 | 4 |
app/schemas/usage_logs.py | wiki-yu/fastapi-algorithm-library | 0 | 11554 | <gh_stars>0
from typing import Optional, List
from pydantic import BaseModel
class UsageLog(BaseModel):
api_key: str
is_active: bool
never_expire: bool
expiration_date: str
latest_query_date: Optional[str]
total_queries: int
class UsageLogs(BaseModel):
logs: List[UsageLog]
| from typing import Optional, List
from pydantic import BaseModel
class UsageLog(BaseModel):
api_key: str
is_active: bool
never_expire: bool
expiration_date: str
latest_query_date: Optional[str]
total_queries: int
class UsageLogs(BaseModel):
logs: List[UsageLog] | none | 1 | 2.250067 | 2 | |
dstf/core.py | anthonydugois/dstf | 0 | 11555 | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from math import inf
from typing import Iterator, Any, List, Dict, Type, Optional
EPSILON = 1e-4
class Error(Exception):
pass
class ConstraintError(Error):
pass
class Constraint(metaclass=ABCMeta):
@abstractmethod
def isv... | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from math import inf
from typing import Iterator, Any, List, Dict, Type, Optional
EPSILON = 1e-4
class Error(Exception):
pass
class ConstraintError(Error):
pass
class Constraint(metaclass=ABCMeta):
@abstractmethod
def isv... | en | 0.293688 | # def copy(self): # chunk_map = self.taskmap.copy() # # for tsk in chunk_map: # chunk_map[tsk] = chunk_map[tsk].copy() # # return Schedule(chunk_map) | 3.014648 | 3 |
2018/2018_06a.py | davidxiao93/Advent-of-Code | 0 | 11556 | input = """154, 159
172, 84
235, 204
181, 122
161, 337
305, 104
128, 298
176, 328
146, 71
210, 87
341, 195
50, 96
225, 151
86, 171
239, 68
79, 50
191, 284
200, 122
282, 240
224, 282
327, 74
158, 289
331, 244
154, 327
317, 110
272, 179
173, 175
187, 104
44, 194
202, 332
249, 197
244, 225
52, 127
299, 198
123, 198
349, 7... | input = """154, 159
172, 84
235, 204
181, 122
161, 337
305, 104
128, 298
176, 328
146, 71
210, 87
341, 195
50, 96
225, 151
86, 171
239, 68
79, 50
191, 284
200, 122
282, 240
224, 282
327, 74
158, 289
331, 244
154, 327
317, 110
272, 179
173, 175
187, 104
44, 194
202, 332
249, 197
244, 225
52, 127
299, 198
123, 198
349, 7... | en | 0.6587 | 154, 159 172, 84 235, 204 181, 122 161, 337 305, 104 128, 298 176, 328 146, 71 210, 87 341, 195 50, 96 225, 151 86, 171 239, 68 79, 50 191, 284 200, 122 282, 240 224, 282 327, 74 158, 289 331, 244 154, 327 317, 110 272, 179 173, 175 187, 104 44, 194 202, 332 249, 197 244, 225 52, 127 299, 198 123, 198 349, 75 233, 72 2... | 3.367212 | 3 |
tests/test_backup.py | KonstantinPankratov/Backupy | 1 | 11557 | <gh_stars>1-10
import os
from Backupy import Backupy
def test_backup():
backup = Backupy()
backup.add_directory('./')
backup.start()
assert os.path.exists(backup.filename)
os.remove(backup.filename)
| import os
from Backupy import Backupy
def test_backup():
backup = Backupy()
backup.add_directory('./')
backup.start()
assert os.path.exists(backup.filename)
os.remove(backup.filename) | none | 1 | 2.37664 | 2 | |
tweetf0rm/process/crawler_process.py | amaurywalbert/mytweetf0rm | 1 | 11558 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
import logging
logger = logging.getLogger(__name__)
import multiprocessing as mp
import tweetf0rm.handler
from tweetf0rm.redis_helper import CrawlerQueue
#MAX_QUEUE_SIZE = 32767
class CrawlerProcess(mp.Process):
def __init__(self, node_id, crawler_id, redis_config, ha... | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
import logging
logger = logging.getLogger(__name__)
import multiprocessing as mp
import tweetf0rm.handler
from tweetf0rm.redis_helper import CrawlerQueue
#MAX_QUEUE_SIZE = 32767
class CrawlerProcess(mp.Process):
def __init__(self, node_id, crawler_id, redis_config, ha... | en | 0.347499 | #!/usr/bin/python # -*- coding: utf-8 -*- # #MAX_QUEUE_SIZE = 32767 #self.queue = mp.Queue(maxsize=MAX_QUEUE_SIZE) #self.lock = mp.Lock() #self.queue.put(request, block=True) #return self.queue.get(block=True) | 2.482068 | 2 |
cloudify_aws/ec2/resources/dhcp.py | marrowne/cloudify-aws-plugin | 0 | 11559 | # Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | en | 0.759415 | # Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap... | 1.947491 | 2 |
tests/testing_support/sample_applications.py | douglasfarinelli/newrelic-python-agent | 1 | 11560 | # Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | en | 0.868149 | # Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ... | 2.038196 | 2 |
spydrnet_tmr/transformation/replication/nmr.py | byuccl/spydrnet-tmr | 0 | 11561 | from spydrnet.ir import Port, Instance, InnerPin
from spydrnet_tmr.transformation.util import add_suffix_to_name
IN = Port.Direction.IN
OUT = Port.Direction.OUT
INOUT = Port.Direction.INOUT
def apply_nmr(ports_and_instances_to_replicate, degree, name_suffix='NMR', rename_original=True):
"""
Replicate the sele... | from spydrnet.ir import Port, Instance, InnerPin
from spydrnet_tmr.transformation.util import add_suffix_to_name
IN = Port.Direction.IN
OUT = Port.Direction.OUT
INOUT = Port.Direction.INOUT
def apply_nmr(ports_and_instances_to_replicate, degree, name_suffix='NMR', rename_original=True):
"""
Replicate the sele... | en | 0.740228 | Replicate the selected ports and instances to the n-th degree. :param ports_and_instances_to_replicate: :param degree: number of total copies :param name_suffix: string to append to each replicated element (e.g. 'TMR' or 'DWC') :param rename_original: rename orginal domain :type rename_original: bo... | 2.681615 | 3 |
pyspark/example/spark_core/4.7_spark_prog.py | chiliangpi/hellobi | 53 | 11562 | <reponame>chiliangpi/hellobi
import os
import numpy as np
import sys
import logging
LOG_PATH = os.environ['log']
spark_home = os.environ['SPARK_HOME']
sys.path.insert(0, os.path.join(spark_home, 'python'))
sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.4-src.zip'))
from pyspark.sql import SparkSess... | import os
import numpy as np
import sys
import logging
LOG_PATH = os.environ['log']
spark_home = os.environ['SPARK_HOME']
sys.path.insert(0, os.path.join(spark_home, 'python'))
sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.4-src.zip'))
from pyspark.sql import SparkSession
spark = SparkSession.bui... | de | 0.211294 | #spark.stop() | 2.507136 | 3 |
infra_macros/fbcode_macros/tests/shell_test.py | xw285cornell/buckit | 0 | 11563 | # Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absol... | # Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absol... | en | 0.852538 | # Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. foo -D'something something \"... | 2.396853 | 2 |
bash/src/_func_storage.py | BillGatesCat/yf | 19 | 11564 | class _FuncStorage:
def __init__(self):
self._function_map = {}
def insert_function(self, name, function):
self._function_map[name] = function
def get_all_functions(self):
return self._function_map
| class _FuncStorage:
def __init__(self):
self._function_map = {}
def insert_function(self, name, function):
self._function_map[name] = function
def get_all_functions(self):
return self._function_map
| none | 1 | 2.377443 | 2 | |
tests/unit/core/SubdomainTest.py | edgargmartinez/OpenPNM | 3 | 11565 | import openpnm as op
import scipy as sp
import pytest
class SubdomainTest:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.GenericGeometry(network=self.net,
... | import openpnm as op
import scipy as sp
import pytest
class SubdomainTest:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.GenericGeometry(network=self.net,
... | en | 0.751627 | # Can't create a subdict below foo # Can create a subdict directly # Can't create a new item already used as subdict # Also works on subdomains # Now start looking across objects # Already exists on pn # pore.foo already exists on pn # pore.baz.bar already exists on pn # Now start looking across objects | 2.077224 | 2 |
loci/io.py | SLIPO-EU/loci | 3 | 11566 | import pandas as pd
from shapely.geometry import Point
import geopandas as gpd
import math
import osmnx
import requests
from io import BytesIO
from zipfile import ZipFile
def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';',
kwds_sep=',... | import pandas as pd
from shapely.geometry import Point
import geopandas as gpd
import math
import osmnx
import requests
from io import BytesIO
from zipfile import ZipFile
def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';',
kwds_sep=',... | en | 0.608506 | Creates a POI GeoDataFrame from an input CSV file. Args: input_file (string): Path to the input csv file. col_id (string): Name of the column containing the POI id (default: `id`). col_name (string): Name of the column containing the POI name (default: `name`). col_lon (string): Nam... | 3.14435 | 3 |
src/roles/wolf.py | timson622222/lykos | 0 | 11567 | import re
import random
from collections import defaultdict
import src.settings as var
from src.utilities import *
from src import debuglog, errlog, plog
from src.decorators import cmd, event_listener
from src.messages import messages
from src.events import Event
KILLS = {} # type: Dict[str, List[str]]
@cmd("kill", ... | import re
import random
from collections import defaultdict
import src.settings as var
from src.utilities import *
from src import debuglog, errlog, plog
from src.decorators import cmd, event_listener
from src.messages import messages
from src.events import Event
KILLS = {} # type: Dict[str, List[str]]
@cmd("kill", ... | en | 0.933965 | # type: Dict[str, List[str]] Kills one or more players as a wolf. # eventually cub will listen on targeted_command and block kills that way # eventually crow will listen on targeted_command and block kills that way # (or more likely, that restriction will be lifted and crow can do both) # need to expand this eventually... | 2.343116 | 2 |
BOG.py | punyajoy/biosbias | 0 | 11568 | <filename>BOG.py
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 13:52:20 2020
@author: midas
"""
import os
import glob
import pandas as pd
import numpy as np
all_filenames=['Data/Train.csv', 'Data/Test.csv']
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ])
combined_csv.to_c... | <filename>BOG.py
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 13:52:20 2020
@author: midas
"""
import os
import glob
import pandas as pd
import numpy as np
all_filenames=['Data/Train.csv', 'Data/Test.csv']
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ])
combined_csv.to_c... | en | 0.807742 | # -*- coding: utf-8 -*- Created on Fri Feb 28 13:52:20 2020
@author: midas # Cleaning the texts # Creating the Bag of Words model #Without Gender # Creating the Bag of Words model | 2.577528 | 3 |
src/ploomber/jupyter/manager.py | idomic/ploomber | 0 | 11569 | <reponame>idomic/ploomber
"""
Module for the jupyter extension
"""
import sys
import datetime
import os
import contextlib
from pprint import pprint
from pathlib import Path
from jupytext.contentsmanager import TextFileContentsManager
from ploomber.sources.notebooksource import (_cleanup_rendered_nb, inject_cell)
from... | """
Module for the jupyter extension
"""
import sys
import datetime
import os
import contextlib
from pprint import pprint
from pathlib import Path
from jupytext.contentsmanager import TextFileContentsManager
from ploomber.sources.notebooksource import (_cleanup_rendered_nb, inject_cell)
from ploomber.spec.dagspec imp... | en | 0.881387 | Module for the jupyter extension Functions functions resolves paths to make the {source} -> {task} mapping work even then `jupyter notebook` is initialized from a subdirectory of pipeline.yaml # FIXME: remove :linenumber Ploomber content manager subclasses jupytext TextFileContentsManager to keep jupytext f... | 1.968572 | 2 |
quake_reporter/quake_datafeed.py | shandozer/quake_reporter | 0 | 11570 | <filename>quake_reporter/quake_datafeed.py
#!/usr/bin/env python
"""
__author__ = <NAME>, 10/8/16
Python 2.7.x
"""
import json
import urllib2
import datetime
import argparse
VERSION = '0.2.1'
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--magnitude', action="store", typ... | <filename>quake_reporter/quake_datafeed.py
#!/usr/bin/env python
"""
__author__ = <NAME>, 10/8/16
Python 2.7.x
"""
import json
import urllib2
import datetime
import argparse
VERSION = '0.2.1'
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--magnitude', action="store", typ... | en | 0.592213 | #!/usr/bin/env python __author__ = <NAME>, 10/8/16 Python 2.7.x # anything less than 2.5 gets the 1.0+ range # a medium sized default # Now grab your data | 3.188945 | 3 |
tests/visualization/data_sources/test_satellite.py | openclimatefix/nowcasting_utils | 2 | 11571 | <reponame>openclimatefix/nowcasting_utils<gh_stars>1-10
""" Tests to plot satellite data """
import os
import plotly.graph_objects as go
from nowcasting_dataset.data_sources.fake.batch import satellite_fake
from nowcasting_dataset.geospatial import osgb_to_lat_lon
from nowcasting_utils.visualization.data_sources.plot... | """ Tests to plot satellite data """
import os
import plotly.graph_objects as go
from nowcasting_dataset.data_sources.fake.batch import satellite_fake
from nowcasting_dataset.geospatial import osgb_to_lat_lon
from nowcasting_utils.visualization.data_sources.plot_satellite import (
make_animation_all_channels,
... | en | 0.533035 | Tests to plot satellite data Test 'make_traces_one_channel_one_time' functions Test 'make_traces_one_channel' functions Test 'make_animation_one_channels' functions Test 'make_animation_all_channels' functions | 2.606973 | 3 |
owtf/__main__.py | Udbhavbisarya23/owtf | 1,514 | 11572 | <gh_stars>1000+
"""
owtf.__main__
~~~~~~~~~~~~~
A __main__ method for OWTF so that internal services can be called as Python modules.
"""
import sys
from owtf.core import main
if __name__ == "__main__":
main()
| """
owtf.__main__
~~~~~~~~~~~~~
A __main__ method for OWTF so that internal services can be called as Python modules.
"""
import sys
from owtf.core import main
if __name__ == "__main__":
main() | en | 0.840563 | owtf.__main__ ~~~~~~~~~~~~~ A __main__ method for OWTF so that internal services can be called as Python modules. | 1.518254 | 2 |
sympyosis/logger.py | ZechCodes/sympyosis | 0 | 11573 | <filename>sympyosis/logger.py
from enum import IntEnum
from typing import Type, TypeVar
import logging
T = TypeVar("T")
class LogLevel(IntEnum):
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ERROR
CRITICAL = logging.CRITICAL
@classmethod
def get(cls... | <filename>sympyosis/logger.py
from enum import IntEnum
from typing import Type, TypeVar
import logging
T = TypeVar("T")
class LogLevel(IntEnum):
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ERROR
CRITICAL = logging.CRITICAL
@classmethod
def get(cls... | none | 1 | 2.693063 | 3 | |
peframe/modules/apialert.py | ki1556ki/MJUOpenSource | 0 | 11574 | # -*- coding: utf-8 -*-
# json 형식 사용을 위한 임폴트
import json
# get함수, 각각의 반복문을 통해 apialert_found안에 문자열 삽입후 리스트형식으로 정렬하여 리턴값 반환.
def get(pe, strings_match):
alerts = strings_match['apialert']
apialert_found = []
# pe에 DIRECTORY_ENTRY_IMPORT라는 변수가 있는지 확인하여 있으면 참 없으면 거짓.
if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):... | # -*- coding: utf-8 -*-
# json 형식 사용을 위한 임폴트
import json
# get함수, 각각의 반복문을 통해 apialert_found안에 문자열 삽입후 리스트형식으로 정렬하여 리턴값 반환.
def get(pe, strings_match):
alerts = strings_match['apialert']
apialert_found = []
# pe에 DIRECTORY_ENTRY_IMPORT라는 변수가 있는지 확인하여 있으면 참 없으면 거짓.
if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):... | ko | 0.996131 | # -*- coding: utf-8 -*- # json 형식 사용을 위한 임폴트 # get함수, 각각의 반복문을 통해 apialert_found안에 문자열 삽입후 리스트형식으로 정렬하여 리턴값 반환. # pe에 DIRECTORY_ENTRY_IMPORT라는 변수가 있는지 확인하여 있으면 참 없으면 거짓. # remove 'null' # imp.name의 문자열안에 alert의 문자열이 있을경우 apialert_found안의 맨뒤에 imp.name을 넣음 | 2.280473 | 2 |
tests/conftest.py | Ninjagod1251/ape | 0 | 11575 | import shutil
from pathlib import Path
from tempfile import mkdtemp
import pytest
from click.testing import CliRunner
import ape
# NOTE: Ensure that we don't use local paths for these
ape.config.DATA_FOLDER = Path(mkdtemp()).resolve()
ape.config.PROJECT_FOLDER = Path(mkdtemp()).resolve()
@pytest.fixture(scope="ses... | import shutil
from pathlib import Path
from tempfile import mkdtemp
import pytest
from click.testing import CliRunner
import ape
# NOTE: Ensure that we don't use local paths for these
ape.config.DATA_FOLDER = Path(mkdtemp()).resolve()
ape.config.PROJECT_FOLDER = Path(mkdtemp()).resolve()
@pytest.fixture(scope="ses... | en | 0.921202 | # NOTE: Ensure that we don't use local paths for these # NOTE: password is 'a' | 2.072285 | 2 |
recipes/Python/576543_Prime_Number_Generator_Checker/recipe-576543.py | tdiprima/code | 2,023 | 11576 | <reponame>tdiprima/code<gh_stars>1000+
#
# prime number generator
# This program gets two number as input
# and prints
# Prime numbers in the range
# Actual number of primes in the range
# and Estimation based on formula
# n
# pi(n)= -------
# log(n)
# ... | #
# prime number generator
# This program gets two number as input
# and prints
# Prime numbers in the range
# Actual number of primes in the range
# and Estimation based on formula
# n
# pi(n)= -------
# log(n)
# pi(n)=number of primes less than n... | en | 0.747518 | # # prime number generator # This program gets two number as input # and prints # Prime numbers in the range # Actual number of primes in the range # and Estimation based on formula # n # pi(n)= ------- # log(n) # pi(n)=number of primes less than n... | 4.139063 | 4 |
Practica 1 E4.py | pardo13/python | 0 | 11577 | <gh_stars>0
A=int(input("dame int"))
B=int(input("dame int"))
if(A>B):
print("A es mayor")
else:
print("B es mayor")
| A=int(input("dame int"))
B=int(input("dame int"))
if(A>B):
print("A es mayor")
else:
print("B es mayor") | none | 1 | 3.830576 | 4 | |
selenium_driver_updater/_phantomJS.py | Svinokur/selenium_driver_updater | 8 | 11578 | #pylint: disable=logging-fstring-interpolation
#Standart library imports
import shutil
import os
import time
from typing import Tuple
from pathlib import Path
import re
from shutil import copyfile
import wget
# Local imports
from selenium_driver_updater.util.logger import logger
from selenium_driver_updater.util.excep... | #pylint: disable=logging-fstring-interpolation
#Standart library imports
import shutil
import os
import time
from typing import Tuple
from pathlib import Path
import re
from shutil import copyfile
import wget
# Local imports
from selenium_driver_updater.util.logger import logger
from selenium_driver_updater.util.excep... | en | 0.669889 | #pylint: disable=logging-fstring-interpolation #Standart library imports # Local imports #assign of specific os Gets latest phantomjs version Returns: str latest_version (str) : Latest version of phantomjs. Compares current version of phantomjs to latest version Returns: ... | 2.126572 | 2 |
src/ychaos/settings.py | vanderh0ff/ychaos | 8 | 11579 | # Copyright 2021, Yahoo
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
from pathlib import Path
from typing import Optional, Union
from pydantic import BaseModel
class ApplicationSettings(BaseModel):
"""
Defines the Global Settings that are consiste... | # Copyright 2021, Yahoo
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
from pathlib import Path
from typing import Optional, Union
from pydantic import BaseModel
class ApplicationSettings(BaseModel):
"""
Defines the Global Settings that are consiste... | en | 0.75961 | # Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms Defines the Global Settings that are consistent in both Development & Production scenarios Defines the Development settings for YChaos Application. Defines the Production settings for Y... | 2.189219 | 2 |
tests/func/test_pipeline.py | kacmak7/dvc | 0 | 11580 | <gh_stars>0
import logging
from dvc.main import main
from tests.basic_env import TestDvc
from tests.func.test_repro import TestRepro
from tests.func.test_repro import TestReproChangedDeepData
class TestPipelineShowSingle(TestDvc):
def setUp(self):
super().setUp()
self.stage = "foo.dvc"
re... | import logging
from dvc.main import main
from tests.basic_env import TestDvc
from tests.func.test_repro import TestRepro
from tests.func.test_repro import TestReproChangedDeepData
class TestPipelineShowSingle(TestDvc):
def setUp(self):
super().setUp()
self.stage = "foo.dvc"
ret = main(["a... | none | 1 | 2.349899 | 2 | |
my_modes/ChaseLoop.py | mjocean/T2Game | 0 | 11581 | <reponame>mjocean/T2Game<filename>my_modes/ChaseLoop.py
import procgame.game
from procgame.game import AdvancedMode
import logging
class ChaseLoop(procgame.game.AdvancedMode):
"""
Example of T2 "Chase Loop" functionality
(described in the rules PDF on page J)
TODO: Sound effects, other visual feedback... | import procgame.game
from procgame.game import AdvancedMode
import logging
class ChaseLoop(procgame.game.AdvancedMode):
"""
Example of T2 "Chase Loop" functionality
(described in the rules PDF on page J)
TODO: Sound effects, other visual feedback??
"""
def __init__(self, game):
super(... | en | 0.754301 | Example of T2 "Chase Loop" functionality (described in the rules PDF on page J) TODO: Sound effects, other visual feedback?? # useful to set-up a custom logger so it's easier to track debugging messages for this mode # the names of the progress lamps as a list for easier code # via indexing, later # the number... | 2.511733 | 3 |
app/dists/admin.py | ariashahverdi/Backend | 0 | 11582 | from django.contrib import admin
from .models import Distribution
admin.site.register(Distribution)
# Register your models here.
| from django.contrib import admin
from .models import Distribution
admin.site.register(Distribution)
# Register your models here.
| en | 0.968259 | # Register your models here. | 1.235702 | 1 |
examples_ltnw/binary_classifier.py | gilbeckers/logictensornetworks | 0 | 11583 | <filename>examples_ltnw/binary_classifier.py
# -*- coding: utf-8 -*-
import logging; logging.basicConfig(level=logging.INFO)
import numpy as np
import matplotlib.pyplot as plt
import logictensornetworks_wrapper as ltnw
nr_samples=500
data=np.random.uniform([0,0],[1.,1.],(nr_samples,2)).astype(np.float32)
data_A=dat... | <filename>examples_ltnw/binary_classifier.py
# -*- coding: utf-8 -*-
import logging; logging.basicConfig(level=logging.INFO)
import numpy as np
import matplotlib.pyplot as plt
import logictensornetworks_wrapper as ltnw
nr_samples=500
data=np.random.uniform([0,0],[1.,1.],(nr_samples,2)).astype(np.float32)
data_A=dat... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.753136 | 3 |
leetcode/0015_3Sum/result.py | theck17/notes | 0 | 11584 | <reponame>theck17/notes
# !/usr/bin/env python3
# Author: C.K
# Email: <EMAIL>
# DateTime:2021-03-15 00:07:14
# Description:
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
result = set()
for i in range(0, len(nums) - 1):
# Reduce the problem to two sum(0)
... | # !/usr/bin/env python3
# Author: C.K
# Email: <EMAIL>
# DateTime:2021-03-15 00:07:14
# Description:
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
result = set()
for i in range(0, len(nums) - 1):
# Reduce the problem to two sum(0)
two_sum = -nums[i... | en | 0.621253 | # !/usr/bin/env python3 # Author: C.K # Email: <EMAIL> # DateTime:2021-03-15 00:07:14 # Description: # Reduce the problem to two sum(0) #sorting to create unique tuples # using tuple in a set will eliminate duplicates combinations | 3.803891 | 4 |
customer/views.py | lautarianoo/django_shop | 0 | 11585 | from django.contrib.auth import authenticate, login
from django.shortcuts import render, redirect
from cart.models import Cart
from django.views import View
from .forms import LoginForm, RegistrationForm, CreateCompanyForm
from customer.models import Customer, ShippingAddress
from src.utils.mixins import CustomerMixin
... | from django.contrib.auth import authenticate, login
from django.shortcuts import render, redirect
from cart.models import Cart
from django.views import View
from .forms import LoginForm, RegistrationForm, CreateCompanyForm
from customer.models import Customer, ShippingAddress
from src.utils.mixins import CustomerMixin
... | none | 1 | 2.168106 | 2 | |
kickstarter/app.py | Annapurnaj91/kickstarter3 | 0 | 11586 | from flask import Flask, render_template, request
# from .recommendation import *
# import pickle
import pandas as pd
import numpy as np
# import keras
# from keras.models import load_model
import pickle
def create_app():
# initializes our app
APP = Flask(__name__)
@APP.route('/')
def form():
... | from flask import Flask, render_template, request
# from .recommendation import *
# import pickle
import pandas as pd
import numpy as np
# import keras
# from keras.models import load_model
import pickle
def create_app():
# initializes our app
APP = Flask(__name__)
@APP.route('/')
def form():
... | en | 0.341698 | # from .recommendation import * # import pickle # import keras # from keras.models import load_model # initializes our app # Get form data # print(prediction[0]) # test_data = (blurb) # print(test_data) # test_data = test_data.reshape(1, -1) # print(test_data) #file = open("model.pkl", "wb") # model = pickle.load( # ... | 2.741851 | 3 |
src/apiron/service/discoverable.py | tushar-deepsource/apiron | 109 | 11587 | from typing import List, Type
from apiron.service.base import ServiceBase
class DiscoverableService(ServiceBase):
"""
A Service whose hosts are determined via a host resolver.
A host resolver is any class with a :func:`resolve` method
that takes a service name as its sole argument
and returns a l... | from typing import List, Type
from apiron.service.base import ServiceBase
class DiscoverableService(ServiceBase):
"""
A Service whose hosts are determined via a host resolver.
A host resolver is any class with a :func:`resolve` method
that takes a service name as its sole argument
and returns a l... | en | 0.964702 | A Service whose hosts are determined via a host resolver. A host resolver is any class with a :func:`resolve` method that takes a service name as its sole argument and returns a list of host names that correspond to that service. | 2.964286 | 3 |
src/plotman/plot_util.py | rafaelsteil/plotman | 0 | 11588 | <filename>src/plotman/plot_util.py
import math
import os
import re
import shutil
from plotman import job
GB = 1_000_000_000
def df_b(d):
'Return free space for directory (in bytes)'
usage = shutil.disk_usage(d)
return usage.free
def get_k32_plotsize():
return 108 * GB
def is_valid_plot_dst(d, sched... | <filename>src/plotman/plot_util.py
import math
import os
import re
import shutil
from plotman import job
GB = 1_000_000_000
def df_b(d):
'Return free space for directory (in bytes)'
usage = shutil.disk_usage(d)
return usage.free
def get_k32_plotsize():
return 108 * GB
def is_valid_plot_dst(d, sched... | en | 0.907306 | # Subtract space for current jobs which will be moved to the dir # Note: This is underestimates the free space available when a # job is in phase 4 since the plot is partially moved to dst, # once phase 4 is complete a new plot will eventually kick off Take items, distribute among n_cols columns, and return... | 2.60127 | 3 |
src/config.py | forkedbranch/femm-opt | 1 | 11589 | <filename>src/config.py
# (c) Copyright 2016 forkedbranch (http://forkedbranch.eu/)
# Licensed under the Apache License, Version 2.0
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
def get_input_folder():
return config['DEFAULT']['InputFolder']
def get_output_folder():
... | <filename>src/config.py
# (c) Copyright 2016 forkedbranch (http://forkedbranch.eu/)
# Licensed under the Apache License, Version 2.0
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
def get_input_folder():
return config['DEFAULT']['InputFolder']
def get_output_folder():
... | en | 0.667049 | # (c) Copyright 2016 forkedbranch (http://forkedbranch.eu/) # Licensed under the Apache License, Version 2.0 | 1.72301 | 2 |
vespene/workers/registration.py | Conan-Kudo/vespene | 680 | 11590 | # Copyright 2018, <NAME> LLC
# License: Apache License Version 2.0
# -------------------------------------------------------------------------
# registration.py - updates the database to say who is building something
# and what the current settings are, which is used by the file serving
# code to see if it is ok ... | # Copyright 2018, <NAME> LLC
# License: Apache License Version 2.0
# -------------------------------------------------------------------------
# registration.py - updates the database to say who is building something
# and what the current settings are, which is used by the file serving
# code to see if it is ok ... | en | 0.573692 | # Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # registration.py - updates the database to say who is building something # and what the current settings are, which is used by the file serving # code to see if it is ok ... | 2.046921 | 2 |
tests/test_db_mathes_ui.py | AlexRovan/Python_training | 0 | 11591 | <filename>tests/test_db_mathes_ui.py
from model.group import Group
from model.contact import Contact
def test_group_list(app,db):
ui_group = app.group.get_groups_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
bd_group = map(clean,db.get_group_list())
assert sorted(u... | <filename>tests/test_db_mathes_ui.py
from model.group import Group
from model.contact import Contact
def test_group_list(app,db):
ui_group = app.group.get_groups_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
bd_group = map(clean,db.get_group_list())
assert sorted(u... | none | 1 | 2.49725 | 2 | |
10 Days of Statistics/Day 5 - Normal Distribution I.py | sohammanjrekar/HackerRank | 0 | 11592 | <reponame>sohammanjrekar/HackerRank<filename>10 Days of Statistics/Day 5 - Normal Distribution I.py
"""
Day 5: Normal Distribution I
In certain plant, the time taken to assemble a car is a random variable, X having a normal distribution
with a mean of 20 hours and a standard deviation of 2 hours. What is the proba... | Days of Statistics/Day 5 - Normal Distribution I.py
"""
Day 5: Normal Distribution I
In certain plant, the time taken to assemble a car is a random variable, X having a normal distribution
with a mean of 20 hours and a standard deviation of 2 hours. What is the probability that a car can be
assembled at this plan... | en | 0.901677 | Day 5: Normal Distribution I
In certain plant, the time taken to assemble a car is a random variable, X having a normal distribution
with a mean of 20 hours and a standard deviation of 2 hours. What is the probability that a car can be
assembled at this plant in:
1. Less han 19.5 hours?
2. Between 20 and 22 ho... | 3.49542 | 3 |
11024/11024.py3.py | isac322/BOJ | 14 | 11593 | for _ in range(int(input())):
print(sum(map(int, input().split()))) | for _ in range(int(input())):
print(sum(map(int, input().split()))) | none | 1 | 2.914761 | 3 | |
tests/test_contact_form.py | LaudateCorpus1/apostello | 69 | 11594 | import pytest
from apostello import models
@pytest.mark.slow
@pytest.mark.django_db
class TestContactForm:
"""Test the sending of SMS."""
def test_number_permissions_staff_exception(self, recipients, users):
"""Test sending a message now."""
calvin = recipients["calvin"]
# check good... | import pytest
from apostello import models
@pytest.mark.slow
@pytest.mark.django_db
class TestContactForm:
"""Test the sending of SMS."""
def test_number_permissions_staff_exception(self, recipients, users):
"""Test sending a message now."""
calvin = recipients["calvin"]
# check good... | en | 0.73532 | Test the sending of SMS. Test sending a message now. # check good post: # check good post: Test sending a message now. # check good post: # check good post: | 2.289899 | 2 |
tests/unit/records/format_hints.py | cwegrzyn/records-mover | 36 | 11595 | <reponame>cwegrzyn/records-mover
bluelabs_format_hints = {
'field-delimiter': ',',
'record-terminator': "\n",
'compression': 'GZIP',
'quoting': None,
'quotechar': '"',
'doublequote': False,
'escape': '\\',
'encoding': 'UTF8',
'dateformat': 'YYYY-MM-DD',
'timeonlyformat': 'HH24:MI... | bluelabs_format_hints = {
'field-delimiter': ',',
'record-terminator': "\n",
'compression': 'GZIP',
'quoting': None,
'quotechar': '"',
'doublequote': False,
'escape': '\\',
'encoding': 'UTF8',
'dateformat': 'YYYY-MM-DD',
'timeonlyformat': 'HH24:MI:SS',
'datetimeformattz': 'YY... | none | 1 | 1.799858 | 2 | |
CONST.py | Bobobert/DQN-Vanilla | 0 | 11596 | # FROM THE OP PAPER-ISH
MINI_BATCH_SIZE = 32
MEMORY_SIZE = 10**6
BUFFER_SIZE = 100
LHIST = 4
GAMMA = 0.99
UPDATE_FREQ_ONlINE = 4
UPDATE_TARGET = 2500 # This was 10**4 but is measured in actor steps, so it's divided update_freq_online
TEST_FREQ = 5*10**4 # Measure in updates
TEST_STEPS = 10**4
LEARNING_RATE = 0.00025
G_... | # FROM THE OP PAPER-ISH
MINI_BATCH_SIZE = 32
MEMORY_SIZE = 10**6
BUFFER_SIZE = 100
LHIST = 4
GAMMA = 0.99
UPDATE_FREQ_ONlINE = 4
UPDATE_TARGET = 2500 # This was 10**4 but is measured in actor steps, so it's divided update_freq_online
TEST_FREQ = 5*10**4 # Measure in updates
TEST_STEPS = 10**4
LEARNING_RATE = 0.00025
G_... | en | 0.970438 | # FROM THE OP PAPER-ISH # This was 10**4 but is measured in actor steps, so it's divided update_freq_online # Measure in updates # MISC #DROPS = [0.0,0.15,0.1,0.0] | 1.321921 | 1 |
milieu/paper/methods/milieu.py | seyuboglu/milieu | 1 | 11597 |
import os
import json
import logging
from collections import defaultdict
import numpy as np
import networkx as nx
import torch
from torch.utils.data import DataLoader
from torch.optim import Adam
from tqdm import tqdm
from milieu.util.util import place_on_cpu, place_on_gpu
from milieu.paper.methods.method import D... |
import os
import json
import logging
from collections import defaultdict
import numpy as np
import networkx as nx
import torch
from torch.utils.data import DataLoader
from torch.optim import Adam
from tqdm import tqdm
from milieu.util.util import place_on_cpu, place_on_gpu
from milieu.paper.methods.method import D... | en | 0.698117 | GCN method class # ensure no data leakage Trains the underlying model Compute the scores predicted by GCN. Args: # Adjacency: Get sparse representation of ppi_adj | 2.11714 | 2 |
scripts/telegram_bot.py | luigi311/ArBluna | 18 | 11598 | <filename>scripts/telegram_bot.py<gh_stars>10-100
import os
import distutils.util
from telegram import Update
from telegram.ext import Updater, CommandHandler, Filters, CallbackContext
from dotenv import load_dotenv
from scripts.get_info import get_ratio
from scripts.terra import get_balances, execute_swap
load_dote... | <filename>scripts/telegram_bot.py<gh_stars>10-100
import os
import distutils.util
from telegram import Update
from telegram.ext import Updater, CommandHandler, Filters, CallbackContext
from dotenv import load_dotenv
from scripts.get_info import get_ratio
from scripts.terra import get_balances, execute_swap
load_dote... | en | 0.801366 | Send a message when the command /ping is issued. Send list of commands when /help is issued. Send the current luna to bluna ratio. Send the current luna to bluna ratio. Send the current luna to bluna ratio. Send the current balances of the account. Force swap to bluna. Force swap to luna. # Create the Updater and pass ... | 2.455836 | 2 |
envs/mujoco/utils/download_meshes.py | hzm2016/assistive-gym-robosuite | 1 | 11599 | <reponame>hzm2016/assistive-gym-robosuite
import os
import zipfile
import requests
def check_and_download(name, google_id, files=None, force_download=False):
"""
Checks if the meshes folder exists in the xml directory
If not it will ask the user if they want to download them
to be able to proceed
Parameters
--... | import os
import zipfile
import requests
def check_and_download(name, google_id, files=None, force_download=False):
"""
Checks if the meshes folder exists in the xml directory
If not it will ask the user if they want to download them
to be able to proceed
Parameters
----------
name: string
the file or direc... | en | 0.645192 | Checks if the meshes folder exists in the xml directory If not it will ask the user if they want to download them to be able to proceed Parameters ---------- name: string the file or directory to download google_id: string the google id that points to the location of the zip file. This should be stored in ... | 3.403215 | 3 |