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
src/Resources.py
softwarespartan/AGT
0
6632251
from boto.s3.key import Key from boto.s3.connection import S3Connection,OrdinaryCallingFormat import re,os,pyDate,Utils; import multiprocessing WL_SP3_BUCKET = 'edu.mbevis.osu.data' ; WL_NAV_BUCKET = 'edu.mbevis.osu.data' ; WL_RES_BUCKET = 'edu.mbevis.osu.resources' ; WL_SOLN_BUCKET= 'edu.mbev...
from boto.s3.key import Key from boto.s3.connection import S3Connection,OrdinaryCallingFormat import re,os,pyDate,Utils; import multiprocessing WL_SP3_BUCKET = 'edu.mbevis.osu.data' ; WL_NAV_BUCKET = 'edu.mbevis.osu.data' ; WL_RES_BUCKET = 'edu.mbevis.osu.resources' ; WL_SOLN_BUCKET= 'edu.mbev...
en
0.665097
# local dir relative work_dir for resources # initialize a date object # create string version of the gps week # make sure that the string is 5 characters # create the file name of the sp3 # set outdir to current directory if not set # init s3 connection to the metadata bucket # check if the sp3 file listing was empty ...
2.138402
2
install/app_store/tk-framework-qtwidgets/v2.6.5/python/elided_label/elided_label.py
JoanAzpeitia/lp_sg
0
6632252
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to t...
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to t...
en
0.737358
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
2.629557
3
python_project_movies/server.py
Pulecz/edu
2
6632253
import moviedb.db import moviedb.sqla import flask from flask import Flask from flask import jsonify app = Flask(__name__) db_instance = moviedb.sqla.SqlAlchemyFilmStorage( "sqlite:///sqla.db") @app.route('/') def hello_world(): all_movies = db_instance.get_all() return flask.render_template( "...
import moviedb.db import moviedb.sqla import flask from flask import Flask from flask import jsonify app = Flask(__name__) db_instance = moviedb.sqla.SqlAlchemyFilmStorage( "sqlite:///sqla.db") @app.route('/') def hello_world(): all_movies = db_instance.get_all() return flask.render_template( "...
en
0.708822
# for debug # populate a db # define empty dict for result # get all movies # save list_of_films to result with title as a key # return only wanted_film # use flask.jsonify for return json
3.181064
3
setup.py
may-/vizseq
0
6632254
<reponame>may-/vizseq<gh_stars>0 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from setuptools import setup, find_packages import sys if sys.version_info < (3,): ...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from setuptools import setup, find_packages import sys if sys.version_info < (3,): sys.exit('Sorry, Python 3 is req...
en
0.94216
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. #
1.33741
1
outlook_msg/constants.py
hiendang/outlook_msg
17
6632255
import enum PROPERTIES_NAME = '__properties_version1.0' ATTACHMENTS_PREFIX = '__attach_version1.0_#' SUBSTG_PREFIX = '__substg1.0_' PROPERTY_IDS = { '0x0C1F': 'PidTagSenderEmailAddress', '0x0037': 'PidTagSubject', '0x1000': 'PidTagBody', '0x1013': 'PidTagBodyHtml', '0x1009': 'PidTagRtfCompressed'...
import enum PROPERTIES_NAME = '__properties_version1.0' ATTACHMENTS_PREFIX = '__attach_version1.0_#' SUBSTG_PREFIX = '__substg1.0_' PROPERTY_IDS = { '0x0C1F': 'PidTagSenderEmailAddress', '0x0037': 'PidTagSubject', '0x1000': 'PidTagBody', '0x1013': 'PidTagBodyHtml', '0x1009': 'PidTagRtfCompressed'...
en
0.73964
#' # Attachments # Null-terminated String in UTF-16LE # 1 or 0 # 8 bytes; a 64-bit integer representing the number of 100-nanosecond intervals since January 1, 1601 # 16 bytes; a GUID with Data1, Data2, and Data3 fields in little-endian format # Null/Placeholder # '0x0000': '', # Special, ROP, to be handled specially #...
2.034198
2
test/mlprogram/entrypoint/test_evaluate.py
HiroakiMikami/mlprogram
9
6632256
import multiprocessing as mp import os import tempfile import pytest import torch from mlprogram import distributed from mlprogram.builtins import Environment from mlprogram.entrypoint import evaluate from mlprogram.entrypoint.evaluate import EvaluateSynthesizer, Result from mlprogram.metrics import Accuracy, Bleu, u...
import multiprocessing as mp import os import tempfile import pytest import torch from mlprogram import distributed from mlprogram.builtins import Environment from mlprogram.entrypoint import evaluate from mlprogram.entrypoint.evaluate import EvaluateSynthesizer, Result from mlprogram.metrics import Accuracy, Bleu, u...
none
1
2.177581
2
handgesturecode-master/proj.py
NikisCodes/Machine-Learning
7
6632257
<filename>handgesturecode-master/proj.py # coding: utf-8 # In[ ]: import numpy as np import mxnet as mx import time import pandas as pd import cv2 import logging logging.getLogger().setLevel(logging.DEBUG) # logging to stdout # In[ ]: #import matplotlib.pyplot as plt #get_ipython().magic('matplotlib inline')...
<filename>handgesturecode-master/proj.py # coding: utf-8 # In[ ]: import numpy as np import mxnet as mx import time import pandas as pd import cv2 import logging logging.getLogger().setLevel(logging.DEBUG) # logging to stdout # In[ ]: #import matplotlib.pyplot as plt #get_ipython().magic('matplotlib inline')...
en
0.246213
# coding: utf-8 # In[ ]: # logging to stdout # In[ ]: #import matplotlib.pyplot as plt #get_ipython().magic('matplotlib inline') # In[ ]: # In[ ]: #data0.head() # In[ ]: #data0['state'].unique() # In[ ]: #num_class, ges_to_num # In[ ]: # In[ ]: #data0.shape[0] # In[ ]: #imgs.shape, labels.shape # In[ ]: # In[ ]: # test...
2.456936
2
tests/test_web_maps.py
blurks/clld
32
6632258
<filename>tests/test_web_maps.py<gh_stars>10-100 import pytest from clld.db.models import common from clld.web.maps import ( Map, ParameterMap, LanguageMap, SelectedLanguagesMap, CombinationMap, FilterLegend, Layer, ) @pytest.mark.parametrize( "route,params,map_cls,ctx_cls,ctx_id", [ ('languag...
<filename>tests/test_web_maps.py<gh_stars>10-100 import pytest from clld.db.models import common from clld.web.maps import ( Map, ParameterMap, LanguageMap, SelectedLanguagesMap, CombinationMap, FilterLegend, Layer, ) @pytest.mark.parametrize( "route,params,map_cls,ctx_cls,ctx_id", [ ('languag...
none
1
2.189091
2
rps.py
enockmecheo/project3
0
6632259
print() import random input("Welcome to Rock, Paper, Scissors! Press enter to start.") my_score=0 comp_score=0 while True: print() my_choice=input("Rock, Paper, or Scissors?: ").lower() while my_choice != "rock" and my_choice != "paper" and my_choice != "scissors": my_choice = input("Invalid...
print() import random input("Welcome to Rock, Paper, Scissors! Press enter to start.") my_score=0 comp_score=0 while True: print() my_choice=input("Rock, Paper, or Scissors?: ").lower() while my_choice != "rock" and my_choice != "paper" and my_choice != "scissors": my_choice = input("Invalid...
none
1
4.279267
4
moveTypes.py
peaceknight05/sstmon
0
6632260
<reponame>peaceknight05/sstmon<gh_stars>0 import effect from enum import Enum class MoveTypes(Enum): LEAF_WHIRLWIND = 0 QUASI_PROTECT = 1 REBOUND_SMASH = 2 NATURES_FURY = 3 CRIMSON_CHARGE = 4 TACKLE = 5 UNNERVING_GROWL = 6 DART_BULLET = 7
import effect from enum import Enum class MoveTypes(Enum): LEAF_WHIRLWIND = 0 QUASI_PROTECT = 1 REBOUND_SMASH = 2 NATURES_FURY = 3 CRIMSON_CHARGE = 4 TACKLE = 5 UNNERVING_GROWL = 6 DART_BULLET = 7
none
1
2.214812
2
Published/SourceCode/Python/API/DynamicArrayStack.py
ChalmersGU-data-structure-courses/OpenDSA
0
6632261
from API import Stack class DynamicArrayStack(Stack): _minCapacity = 8 # Minimum capacity of internalArray _minLoadFactor = 0.5 # Must be smaller than 1/CapacityMultiplier _capacityMultiplier = 1.5 # Factor to grow/shrink the capacity def __init__(self): self._internalArra...
from API import Stack class DynamicArrayStack(Stack): _minCapacity = 8 # Minimum capacity of internalArray _minLoadFactor = 0.5 # Must be smaller than 1/CapacityMultiplier _capacityMultiplier = 1.5 # Factor to grow/shrink the capacity def __init__(self): self._internalArra...
en
0.514466
# Minimum capacity of internalArray # Must be smaller than 1/CapacityMultiplier # Factor to grow/shrink the capacity # Internal array containing the stack elements # Size of stack, and index of the next free slot # For garbage collection ##################################################################################...
3.07955
3
number_theory/euclids_algorithm.py
sanjayjha97/datastructures
0
6632262
# Euclid's Lemma : d divides a and b, if and only if d divides a-b and b # Euclid's Algorithm def gcd(a, b): if a < b: a, b = b, a while a % b != 0: a, b = b, a % b return b # Recursive Euclid's Algorithm def recursive_gcd(a, b): if b == 0: return a return recursive_g...
# Euclid's Lemma : d divides a and b, if and only if d divides a-b and b # Euclid's Algorithm def gcd(a, b): if a < b: a, b = b, a while a % b != 0: a, b = b, a % b return b # Recursive Euclid's Algorithm def recursive_gcd(a, b): if b == 0: return a return recursive_g...
en
0.558616
# Euclid's Lemma : d divides a and b, if and only if d divides a-b and b # Euclid's Algorithm # Recursive Euclid's Algorithm
3.775764
4
data_structures/test_trie.py
prekolna/AlgorithmsGreatestHits
1
6632263
<filename>data_structures/test_trie.py import unittest import random import re from .trie import Trie class TrieTests(unittest.TestCase): def setUp(self): self.test_emails = [ "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>" ] self.not_present_email = "<EMAIL>" self.vowel_pattern = re.compile("[a...
<filename>data_structures/test_trie.py import unittest import random import re from .trie import Trie class TrieTests(unittest.TestCase): def setUp(self): self.test_emails = [ "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>" ] self.not_present_email = "<EMAIL>" self.vowel_pattern = re.compile("[a...
none
1
3.544395
4
scripts/fundamentals/cls_multiple_inheritance_example.py
duttashi/learnpy
0
6632264
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sun Oct 18 13:41:59 2020 An example of multiple inheritance Notes: 1. Any class can inherit from multiple classes 2. Python normally uses "depth-first" order, when searching inheriting classes. 3. But when two classes inherit from the same class...
# -*- coding: utf-8 -*- """ Created on Sun Oct 18 13:41:59 2020 An example of multiple inheritance Notes: 1. Any class can inherit from multiple classes 2. Python normally uses "depth-first" order, when searching inheriting classes. 3. But when two classes inherit from the same class. 4. Py...
en
0.750583
# -*- coding: utf-8 -*- Created on Sun Oct 18 13:41:59 2020 An example of multiple inheritance Notes: 1. Any class can inherit from multiple classes 2. Python normally uses "depth-first" order, when searching inheriting classes. 3. But when two classes inherit from the same class. 4. Python e...
4.294317
4
miniproject/first/food.py
annisanurdiana/python_programming
5
6632265
<filename>miniproject/first/food.py from menu_item import MenuItem class Food(MenuItem): def __init__(self, name, price, calorie_count): super().__init__(name, price) self.calorie_count = calorie_count def info(self): return self.name + ': $' + str(self.price) + ' (' + str(self.calorie...
<filename>miniproject/first/food.py from menu_item import MenuItem class Food(MenuItem): def __init__(self, name, price, calorie_count): super().__init__(name, price) self.calorie_count = calorie_count def info(self): return self.name + ': $' + str(self.price) + ' (' + str(self.calorie...
none
1
3.472027
3
aysa_commands/_docker.py
alejandrobernardis/aysa-commands
1
6632266
# Author: <NAME> # Email: <EMAIL>is at gmail.com # Created: 2019/10/30 # ~ ############################################################################### # Docker Registry Documentation: https://docs.docker.com/registry/ # ############################################################################### # TO...
# Author: <NAME> # Email: <EMAIL>is at gmail.com # Created: 2019/10/30 # ~ ############################################################################### # Docker Registry Documentation: https://docs.docker.com/registry/ # ############################################################################### # TO...
es
0.279406
# Author: <NAME> # Email: <EMAIL>is at gmail.com # Created: 2019/10/30 # ~ ############################################################################### # Docker Registry Documentation: https://docs.docker.com/registry/ # ############################################################################### # TOD...
1.970483
2
openstack/telemetry/v2/capability.py
mail2nsrajesh/python-openstacksdk
0
6632267
<gh_stars>0 # 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 # distrib...
# 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 t...
en
0.874687
# 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 t...
1.781276
2
pydantic/utils.py
kataev/pydantic
0
6632268
<reponame>kataev/pydantic import inspect import re import sys from contextlib import contextmanager from enum import Enum from functools import lru_cache from importlib import import_module from textwrap import dedent from typing import _eval_type # type: ignore from typing import TYPE_CHECKING, Any, Dict, Generator, ...
import inspect import re import sys from contextlib import contextmanager from enum import Enum from functools import lru_cache from importlib import import_module from textwrap import dedent from typing import _eval_type # type: ignore from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Pattern, T...
en
0.813459
# type: ignore # type: ignore # type: ignore # type: ignore # python 3.6 # pragma: no cover # noqa: F401 Brutally simple email address validation. Note unlike most email address validation * raw ip address (literal) domain parts are not allowed. * "<NAME> <<EMAIL>>" style "pretty" email addresses are processed ...
2.369275
2
cargonet/dataset/avgdelayv1.py
romnnn/rail-stgcnn
2
6632269
import os.path import shutil import statistics from collections import defaultdict from datetime import datetime, timedelta import networkx as nx import torch import torch_geometric from torch_geometric.data import Dataset import cargonet.preprocessing.datalake.retrieval as retrieval import cargonet.preprocessing.gra...
import os.path import shutil import statistics from collections import defaultdict from datetime import datetime, timedelta import networkx as nx import torch import torch_geometric from torch_geometric.data import Dataset import cargonet.preprocessing.datalake.retrieval as retrieval import cargonet.preprocessing.gra...
en
0.893031
# Start with the full network and iteratively apply the considered states # Apply running averages # print("KEY ERROR!!") Edges are important here # Read transport state at time step t and some previous steps # Enforce undirected # Plot combined graph # Extract important features and convert nx graph to a tg graph # Ap...
2.021258
2
model/mosesdecoder/contrib/moses-speedtest/testsuite_common.py
saeedesm/UNMT_AH
3
6632270
<gh_stars>1-10 """Common functions of the testsuitce""" import os #Clour constants class bcolors: PURPLE = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' ENDC = '\033[0m' class LogLine: """A class to contain logfile line""" def __init__(self, date, ...
"""Common functions of the testsuitce""" import os #Clour constants class bcolors: PURPLE = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' ENDC = '\033[0m' class LogLine: """A class to contain logfile line""" def __init__(self, date, time, revision,...
en
0.909571
Common functions of the testsuitce #Clour constants A class to contain logfile line A class to contain results of benchmarking #Produce a percentage with fewer digits Parses the log line into a nice datastructure Just a call to tail to get the diff between the last two runs #Check for new tests
2.958709
3
rplugin/python3/wilder/__init__.py
ratheesh/wilder.nvim
0
6632271
<filename>rplugin/python3/wilder/__init__.py import asyncio import concurrent.futures import difflib import fnmatch import functools import glob import importlib from importlib.util import find_spec import itertools import multiprocessing import os from pathlib import Path import pwd import shutil import threading impo...
<filename>rplugin/python3/wilder/__init__.py import asyncio import concurrent.futures import difflib import fnmatch import functools import glob import importlib from importlib.util import find_spec import itertools import multiprocessing import os from pathlib import Path import pwd import shutil import threading impo...
en
0.538337
#' + command, ctx, x) # re2 does not use re.UNICODE by default # re2 does not use re.UNICODE by default
1.991832
2
wg-manager-backend/database/models.py
SH-Daemon/wg-manager
417
6632272
<reponame>SH-Daemon/wg-manager<filename>wg-manager-backend/database/models.py import datetime import sqlalchemy from sqlalchemy import Integer, Column, DateTime from sqlalchemy.orm import relationship, backref from database.database import Base class User(Base): __tablename__ = "users" id = Column(Integer,...
import datetime import sqlalchemy from sqlalchemy import Integer, Column, DateTime from sqlalchemy.orm import relationship, backref from database.database import Base class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True, index=True) email = Column(sqlalchemy.String, unique=Tr...
none
1
2.745812
3
charm/priors.py
pacargile/charm
0
6632273
<reponame>pacargile/charm<gh_stars>0 import numpy as np class priors(object): """docstring for priors""" def __init__(self, inpriordict): super(priors, self).__init__() # find uniform priors and put them into a # dictionary used for the prior transformation self.priordict = {} # put any additional prior...
import numpy as np class priors(object): """docstring for priors""" def __init__(self, inpriordict): super(priors, self).__init__() # find uniform priors and put them into a # dictionary used for the prior transformation self.priordict = {} # put any additional priors into a dictionary so that # they ...
en
0.855956
docstring for priors # find uniform priors and put them into a # dictionary used for the prior transformation # put any additional priors into a dictionary so that # they can be applied in the lnprior_* functions # split upars
2.43842
2
user_2.py
irachitrastogi/A-Distributed-memory-Store
0
6632274
<reponame>irachitrastogi/A-Distributed-memory-Store import socket import os import multiprocessing as mp import time import json user_id = 1 ####################################################################################################### def user_write_request(user_id, value_to_be_written): print...
import socket import os import multiprocessing as mp import time import json user_id = 1 ####################################################################################################### def user_write_request(user_id, value_to_be_written): print("Write request initiated..............................
de
0.681376
####################################################################################################### #node_status[node_id-1] = True #node_age[node_id-1] = rcvd_mssg["age"] #print('My port is :', port, 'I got the message: ', node_age[node_id-1]) ########################################################################...
2.459507
2
test_connect.py
sbyount/learning_python_2016
0
6632275
from netmiko import ConnectHandler import logging logging.basicConfig(filename='test.log', level=logging.DEBUG) logger = logging.getLogger("my_log") logger.debug('This message should go to the log file') cisco_1002x = { 'device_type': 'cisco_ios', 'ip': '10.9.18.38', 'username': 'zg46503', ...
from netmiko import ConnectHandler import logging logging.basicConfig(filename='test.log', level=logging.DEBUG) logger = logging.getLogger("my_log") logger.debug('This message should go to the log file') cisco_1002x = { 'device_type': 'cisco_ios', 'ip': '10.9.18.38', 'username': 'zg46503', ...
en
0.209127
# optional, defaults to 22 # optional, defaults to '' # optional, defaults to False # Try 2 and then 4 # use telnet instead of ssh # optional, defaults to 22 # optional, defaults to '' # optional, defaults to False # optional, defaults to 22 # optional, defaults to '' # optional, defaults to False #net_connect.send_com...
2.435554
2
extensions/.stubs/clrclasses/__clrclasses__/System/Web/__init__.py
vicwjb/Pycad
1
6632276
<filename>extensions/.stubs/clrclasses/__clrclasses__/System/Web/__init__.py from __clrclasses__.System import Enum as _n_0_t_0 from __clrclasses__.System import IComparable as _n_0_t_1 from __clrclasses__.System import IFormattable as _n_0_t_2 from __clrclasses__.System import IConvertible as _n_0_t_3 from __clrclasse...
<filename>extensions/.stubs/clrclasses/__clrclasses__/System/Web/__init__.py from __clrclasses__.System import Enum as _n_0_t_0 from __clrclasses__.System import IComparable as _n_0_t_1 from __clrclasses__.System import IFormattable as _n_0_t_2 from __clrclasses__.System import IConvertible as _n_0_t_3 from __clrclasse...
en
0.207725
Level { get; set; } -> AspNetHostingPermissionLevel Level { get; set; } -> AspNetHostingPermissionLevel
1.775521
2
employees/urls.py
rcdosado/URO-MIS
0
6632277
from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^dashboard/$', views.dashboard, name='dashboard'), url(r'^logout/$', views.LogoutView.as_view(), name='logout'), url(r'^signup/$', views.SignupView.as_view(), name='signup'), url('^', include('django.co...
from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^dashboard/$', views.dashboard, name='dashboard'), url(r'^logout/$', views.LogoutView.as_view(), name='logout'), url(r'^signup/$', views.SignupView.as_view(), name='signup'), url('^', include('django.co...
none
1
1.726767
2
meizituspider.py
Stephen-Pierre/meizitu_Spider
8
6632278
import requests from bs4 import BeautifulSoup import lxml import os import time import tkinter as tk from tkinter.filedialog import askdirectory headers = {'Referer':'https://www.mzitu.com','User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3679.0 Safari/537.36'...
import requests from bs4 import BeautifulSoup import lxml import os import time import tkinter as tk from tkinter.filedialog import askdirectory headers = {'Referer':'https://www.mzitu.com','User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3679.0 Safari/537.36'...
zh
0.951006
# 构造每一页的链接 # 调用 get_chapter_url爬取 # 获取图片总页数 # 获取图片总页数 # 获取每一页个专题的链接 # 获取专题链接暂存在字典中 # 获取每个专题的所有图片链接并下载 # 根据标题创建文件夹用于保存文件 # 分析每个图片的下载地址并下载图片 # 获取每个专题的图片数量 # 构造每一个图片页的URL # 获取每张图片的下载地址并下载图片 # 保存图片 # 定制图形界面 # 提示用户输入要爬取的页码范围 # 调用get_max_page获取当前最大页码 # 选择路径函数 # 选择路径按钮 # 开始按钮
3.234546
3
tests/utils.py
girish946/supertokens-python
36
6632279
<gh_stars>10-100 # Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy ...
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
en
0.892619
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
1.509005
2
tests/base/database/test_helpers.py
vralex/RumbleRunner
2
6632280
from base import DBHelpers, SessionScope, TelegramUser from tests.utils import InBotTestCase class TestDBUtils(InBotTestCase): def test_select_and_update_by_tg_id(self): new_user = TelegramUser(tg_id=1, first_name='aaa') session = SessionScope.session() session.add(new_user) user_...
from base import DBHelpers, SessionScope, TelegramUser from tests.utils import InBotTestCase class TestDBUtils(InBotTestCase): def test_select_and_update_by_tg_id(self): new_user = TelegramUser(tg_id=1, first_name='aaa') session = SessionScope.session() session.add(new_user) user_...
none
1
2.29226
2
python_modules/dagster-graphql/dagster_graphql_tests/test_multiprocessing.py
david-alexander-white/dagster
1
6632281
import csv import os import time from collections import OrderedDict from copy import deepcopy from dagster_graphql.implementation.pipeline_execution_manager import ( QueueingSubprocessExecutionManager, SubprocessExecutionManager, ) from dagster import ( ExecutionTargetHandle, Field, InputDefiniti...
import csv import os import time from collections import OrderedDict from copy import deepcopy from dagster_graphql.implementation.pipeline_execution_manager import ( QueueingSubprocessExecutionManager, SubprocessExecutionManager, ) from dagster import ( ExecutionTargetHandle, Field, InputDefiniti...
en
0.559351
# pylint: disable=W0613 # pylint: disable=W0613 # pylint: disable=W0212 # ensure both runs have begun execution
2.265943
2
src/gpt2/train_model.py
azadyasar/GPT2
0
6632282
<gh_stars>0 import os os.environ['CUDA_LAUNCH_BLOCKING'] = "1" import argparse import torch import torch.nn as nn import torch.optim as optim from gpt2.utils import fusing from gpt2.modeling import Transformer from gpt2.data import Dataset, VocabSP, VocabYTTM, TokenizedCorpus, MTCorpus from gpt2.training import TrainCo...
import os os.environ['CUDA_LAUNCH_BLOCKING'] = "1" import argparse import torch import torch.nn as nn import torch.optim as optim from gpt2.utils import fusing from gpt2.modeling import Transformer from gpt2.data import Dataset, VocabSP, VocabYTTM, TokenizedCorpus, MTCorpus from gpt2.training import TrainConfig, Traini...
none
1
2.281202
2
setup.py
theNded/pymagsac
59
6632283
#! /usr/bin/env python3 import os import re import sys import sysconfig import platform import subprocess from distutils.version import LooseVersion from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext from setuptools.command.test import test as TestCommand from shu...
#! /usr/bin/env python3 import os import re import sys import sysconfig import platform import subprocess from distutils.version import LooseVersion from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext from setuptools.command.test import test as TestCommand from shu...
en
0.443409
#! /usr/bin/env python3 # Copy *_test file to tests directory #test_bin = os.path.join(self.build_temp, 'python_cpp_example_test') #self.copy_test_file(test_bin) # Add an empty line for cleaner output Copy ``src_file`` to ``dest_file`` ensuring parent directory exists. By default, message like `creating directo...
1.97349
2
core/entities/jello.py
TheArchives/Nexus
1
6632284
# iCraft is Copyright 2010 both # # The Archives team: # <<NAME>> <EMAIL> AKA "Adam01" # <<NAME>> <EMAIL> AKA "Aera" # <<NAME>> <EMAIL> AKA "revenant" # <<NAME>> <EMAIL> AKA "gdude2002" # # And, # # The iCraft team: # ...
# iCraft is Copyright 2010 both # # The Archives team: # <<NAME>> <EMAIL> AKA "Adam01" # <<NAME>> <EMAIL> AKA "Aera" # <<NAME>> <EMAIL> AKA "revenant" # <<NAME>> <EMAIL> AKA "gdude2002" # # And, # # The iCraft team: # ...
en
0.423812
# iCraft is Copyright 2010 both # # The Archives team: # <<NAME>> <EMAIL> AKA "Adam01" # <<NAME>> <EMAIL> AKA "Aera" # <<NAME>> <EMAIL> AKA "revenant" # <<NAME>> <EMAIL> AKA "gdude2002" # # And, # # The iCraft team: # ...
1.399855
1
leetcode/606.py
sputnikW/algorithm
0
6632285
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def tree2str(self, t: TreeNode) -> str: if t is None: return '' # return the required string def pre...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def tree2str(self, t: TreeNode) -> str: if t is None: return '' # return the required string def pre...
en
0.530494
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # return the required string
3.817049
4
world/petitions/admin.py
stesla/arxcode
5
6632286
<reponame>stesla/arxcode # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import BrokeredSale, PurchasedAmount, PetitionParticipation, Petition, PetitionPost class PurchasedAmountInline(admin.TabularInline): """Inline for purchased amounts""" mode...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import BrokeredSale, PurchasedAmount, PetitionParticipation, Petition, PetitionPost class PurchasedAmountInline(admin.TabularInline): """Inline for purchased amounts""" model = PurchasedAmount e...
en
0.851879
# -*- coding: utf-8 -*- Inline for purchased amounts Admin for BrokeredSale Inline for participation in petitions Inline for posts in petitions Admin for petitions
1.878689
2
uptimer/__init__.py
izmirli/uptimer
0
6632287
"""Top-level package for UpTimer.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
"""Top-level package for UpTimer.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
en
0.529205
Top-level package for UpTimer. <NAME>
0.925718
1
merge-k-sorted-lists/merge-k-sorted-lists.py
JeremyTsaii/LeetHub
1
6632288
<filename>merge-k-sorted-lists/merge-k-sorted-lists.py<gh_stars>1-10 # Definition for singly-linked list. # class ListNode(object): #     def __init__(self, val=0, next=None): #         self.val = val #         self.next = next class Solution(object):    def mergeKLists(self, lists):        """       :type lists: L...
<filename>merge-k-sorted-lists/merge-k-sorted-lists.py<gh_stars>1-10 # Definition for singly-linked list. # class ListNode(object): #     def __init__(self, val=0, next=None): #         self.val = val #         self.next = next class Solution(object):    def mergeKLists(self, lists):        """       :type lists: L...
en
0.342808
# Definition for singly-linked list. # class ListNode(object): #     def __init__(self, val=0, next=None): #         self.val = val #         self.next = next :type lists: List[ListNode]       :rtype: ListNode
3.601638
4
slackbot/plugins/hello.py
damdev/dolarbot
0
6632289
#coding: UTF-8 import re from slackbot.bot import respond_to from slackbot.bot import listen_to from slackbot.bot import default_reply import requests def bbva(i): try: b = requests.get('https://hb.bbv.com.ar/fnet/mod/inversiones/NL-dolareuro.jsp') aa = b.text.replace('\t', '').replace('\n', '') ...
#coding: UTF-8 import re from slackbot.bot import respond_to from slackbot.bot import listen_to from slackbot.bot import default_reply import requests def bbva(i): try: b = requests.get('https://hb.bbv.com.ar/fnet/mod/inversiones/NL-dolareuro.jsp') aa = b.text.replace('\t', '').replace('\n', '') ...
ru
0.189046
#coding: UTF-8
2.499282
2
src/foolscap/logging/filter.py
rbalint/foolscap
0
6632290
<reponame>rbalint/foolscap from twisted.python import usage import sys, os, bz2, time from foolscap.logging import log, flogfile from foolscap.util import move_into_place class FilterOptions(usage.Options): stdout = sys.stdout stderr = sys.stderr synopsis = "Usage: flogtool filter [options] OLDFILE NEWFIL...
from twisted.python import usage import sys, os, bz2, time from foolscap.logging import log, flogfile from foolscap.util import move_into_place class FilterOptions(usage.Options): stdout = sys.stdout stderr = sys.stderr synopsis = "Usage: flogtool filter [options] OLDFILE NEWFILE" optParameters = [ ...
en
0.853129
# Win32 can't do an atomic rename to an existing file.
2.23722
2
webapps/ab-testing-results/backend.py
dataiku/dss-plugin-ab-testing
0
6632291
<filename>webapps/ab-testing-results/backend.py from flask import request import dataiku from distutils.util import strtobool import json import traceback import numpy as np import simplejson from dataiku.customwebapp import get_webapp_config from results.ab_calculator import compute_Z_score, compute_p_value from resu...
<filename>webapps/ab-testing-results/backend.py from flask import request import dataiku from distutils.util import strtobool import json import traceback import numpy as np import simplejson from dataiku.customwebapp import get_webapp_config from results.ab_calculator import compute_Z_score, compute_p_value from resu...
none
1
2.372554
2
setup.py
sfairchild/moduler
0
6632292
from setuptools import setup setup( name='Moduler', version='0.0.2', author='<NAME>', author_email='<EMAIL>', packages=['moduler'], scripts=['bin/moduler'], url='#TODO Change this', license='MIT', description='Used to checkout packages into a dire...
from setuptools import setup setup( name='Moduler', version='0.0.2', author='<NAME>', author_email='<EMAIL>', packages=['moduler'], scripts=['bin/moduler'], url='#TODO Change this', license='MIT', description='Used to checkout packages into a dire...
none
1
1.162031
1
penv/features.py
ywchiu/penv
20
6632293
import numpy as np from scipy.special import binom from tensortrade.feed import Stream def fracdiff(s: Stream[float], d: float, window: int) -> Stream[float]: c = np.tile([1.0, -1.0], -(-window // 2))[:window] w = c*binom(d, np.arange(window)) w = w[::-1] frac = s.rolling(window=window, min_periods=w...
import numpy as np from scipy.special import binom from tensortrade.feed import Stream def fracdiff(s: Stream[float], d: float, window: int) -> Stream[float]: c = np.tile([1.0, -1.0], -(-window // 2))[:window] w = c*binom(d, np.arange(window)) w = w[::-1] frac = s.rolling(window=window, min_periods=w...
none
1
2.193373
2
robosuite/controllers/base_controller.py
StanfordVL/Lasersuite
5
6632294
<filename>robosuite/controllers/base_controller.py import abc from collections.abc import Iterable import numpy as np import mujoco_py class Controller(object, metaclass=abc.ABCMeta): """ General controller interface. Requires reference to mujoco sim object, eef_name of specific robot, relevant joint_ind...
<filename>robosuite/controllers/base_controller.py import abc from collections.abc import Iterable import numpy as np import mujoco_py class Controller(object, metaclass=abc.ABCMeta): """ General controller interface. Requires reference to mujoco sim object, eef_name of specific robot, relevant joint_ind...
en
0.728926
General controller interface. Requires reference to mujoco sim object, eef_name of specific robot, relevant joint_indexes to that robot, and whether an initial_joint is used for nullspace torques or not Args: sim (MjSim): Simulator instance this controller will pull robot state updates from ...
2.919991
3
scripts/experiments.py
gijskant/phdthesis-experiments
0
6632295
<reponame>gijskant/phdthesis-experiments #! /usr/bin/env python # :noTabs=true: # (c) Copyright (c) 2017 <NAME> # (c) This file is distributed under the MIT License, # (c) see the file LICENSE. """ experiments.py Brief: Prepares and runs experiments based on json experiments file. Author: <NAME> <<EMAIL>> """ impor...
#! /usr/bin/env python # :noTabs=true: # (c) Copyright (c) 2017 <NAME> # (c) This file is distributed under the MIT License, # (c) see the file LICENSE. """ experiments.py Brief: Prepares and runs experiments based on json experiments file. Author: <NAME> <<EMAIL>> """ import os import sys import json from tools im...
en
0.76206
#! /usr/bin/env python # :noTabs=true: # (c) Copyright (c) 2017 <NAME> # (c) This file is distributed under the MIT License, # (c) see the file LICENSE. experiments.py Brief: Prepares and runs experiments based on json experiments file. Author: <NAME> <<EMAIL>> Generate files required for the experiments. List the e...
2.761049
3
handler.py
ilhan-mstf/tdd-sample-app
0
6632296
import json import logging import re logger = logging.getLogger() logger.setLevel(logging.INFO) def hello_endpoint(event, context): logger.info(event) body = { "message": "Hello world!" } response = { "statusCode": 200, "body": json.dumps(body) } return response def sum_endpoint(event, ...
import json import logging import re logger = logging.getLogger() logger.setLevel(logging.INFO) def hello_endpoint(event, context): logger.info(event) body = { "message": "Hello world!" } response = { "statusCode": 200, "body": json.dumps(body) } return response def sum_endpoint(event, ...
en
0.812832
# Default response # Regex that matches "numbers=1,2,33" # Get numbers from post data
2.78747
3
albumentations/augmentations/geometric/resize.py
code-kage/albumentations
3
6632297
import cv2 import random from . import functional as F from ...core.transforms_interface import DualTransform, to_tuple __all__ = ["RandomScale", "LongestMaxSize", "SmallestMaxSize", "Resize"] class RandomScale(DualTransform): """Randomly resize the input. Output image size is different from the input image siz...
import cv2 import random from . import functional as F from ...core.transforms_interface import DualTransform, to_tuple __all__ = ["RandomScale", "LongestMaxSize", "SmallestMaxSize", "Resize"] class RandomScale(DualTransform): """Randomly resize the input. Output image size is different from the input image siz...
en
0.523062
Randomly resize the input. Output image size is different from the input image size. Args: scale_limit ((float, float) or float): scaling factor range. If scale_limit is a single float value, the range will be (1 - scale_limit, 1 + scale_limit). Default: (0.9, 1.1). interpolation (OpenC...
2.961741
3
bin/AlarmScriptController.py
ToshihitoKon/crystal-signal-lite
19
6632298
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import threading import time import subprocess from os.path import isfile, join from os import listdir import json # - - - - - - - - - - - - - - - - - - # - ALARM SCRIPT CONTROLLER CLASS - # - - - - - - - - - - - - - - - - - - class AlarmScriptController: d...
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import threading import time import subprocess from os.path import isfile, join from os import listdir import json # - - - - - - - - - - - - - - - - - - # - ALARM SCRIPT CONTROLLER CLASS - # - - - - - - - - - - - - - - - - - - class AlarmScriptController: d...
it
0.396743
#!/usr/bin/python # -*- coding: UTF-8 -*- # - - - - - - - - - - - - - - - - - - # - ALARM SCRIPT CONTROLLER CLASS - # - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - # - - - - - - MEMO - - - - - - - # - - - - - - - - - - - - - - - -
2.19928
2
src/signalalign/scripts/empire.py
kishwarshafin/signalAlign
5
6632299
#!/usr/bin/env python """Run signal-to-reference alignments """ import pandas as pd import glob from .signalAlignLib import * from .variantCallingLib import get_alignments_labels_and_mask from .alignmentAnalysisLib import CallMethylation from multiprocessing import Process, Queue, current_process, Manager from signala...
#!/usr/bin/env python """Run signal-to-reference alignments """ import pandas as pd import glob from .signalAlignLib import * from .variantCallingLib import get_alignments_labels_and_mask from .alignmentAnalysisLib import CallMethylation from multiprocessing import Process, Queue, current_process, Manager from signala...
en
0.771292
#!/usr/bin/env python Run signal-to-reference alignments input_sequence: string, input nucleotide sequence out_path: string, path to directory to put new sequences with substituted degenerate characters block_size: not implemented step: number of bases between degenerate characters :return (subbed seque...
2.333734
2
pong/zadania/pong_z7.py
bladerunner666/pyt101
0
6632300
# coding=utf-8 import pygame import pygame.locals class Board(object): """ Plansza do gry. Odpowiada za rysowanie okna gry. """ def __init__(self, width, height): """ Konstruktor planszy do gry. Przygotowuje okienko gry. :param width: :param height: """ ...
# coding=utf-8 import pygame import pygame.locals class Board(object): """ Plansza do gry. Odpowiada za rysowanie okna gry. """ def __init__(self, width, height): """ Konstruktor planszy do gry. Przygotowuje okienko gry. :param width: :param height: """ ...
pl
0.998966
# coding=utf-8 Plansza do gry. Odpowiada za rysowanie okna gry. Konstruktor planszy do gry. Przygotowuje okienko gry. :param width: :param height: Rysuje okno gry :param args: lista obiektów do narysowania # dopiero w tym miejscu następuje fatyczne rysowanie # w oknie gry, wcześniej tylko usta...
3.435099
3
Recursion.py
LeoYuanjieLi/PythonExercise
0
6632301
def make_empty(seq): """ >>> make_empty([1, 2, 3, 4]) [] >>> make_empty(('a', 'b', 'c')) () >>> make_empty("No, not me!") '' """ if type(seq) == list: return list() elif type(seq) == tuple: return tuple() elif type(seq) == str: return str()...
def make_empty(seq): """ >>> make_empty([1, 2, 3, 4]) [] >>> make_empty(('a', 'b', 'c')) () >>> make_empty("No, not me!") '' """ if type(seq) == list: return list() elif type(seq) == tuple: return tuple() elif type(seq) == str: return str()...
en
0.419895
>>> make_empty([1, 2, 3, 4]) [] >>> make_empty(('a', 'b', 'c')) () >>> make_empty("No, not me!") '' >>> insert_at_end(5, [1, 3, 4, 6]) [1, 3, 4, 6, 5] >>> insert_at_end('x', 'abc') 'abcx' >>> insert_at_end(5, (1, 3, 4, 6)) (1, 3, 4, 6, 5) >>> insert_in_front(5...
4.238644
4
scripts/presets/photographer/cameras/olympus_em1_m_zuiko_12mm.py
Tilapiatsu/blender-custom_conf
2
6632302
<filename>scripts/presets/photographer/cameras/olympus_em1_m_zuiko_12mm.py<gh_stars>1-10 import bpy camera = bpy.context.scene.camera.data photographer = bpy.context.scene.camera.data.photographer photographer.sensor_type = '18' photographer.aperture = 1.2 photographer.aperture_preset = '1.2' photographer.aperture_sli...
<filename>scripts/presets/photographer/cameras/olympus_em1_m_zuiko_12mm.py<gh_stars>1-10 import bpy camera = bpy.context.scene.camera.data photographer = bpy.context.scene.camera.data.photographer photographer.sensor_type = '18' photographer.aperture = 1.2 photographer.aperture_preset = '1.2' photographer.aperture_sli...
none
1
1.310077
1
leetcode/633.py
Cannizza-zzk/python_review
0
6632303
<reponame>Cannizza-zzk/python_review class Solution: def judgeSquareSum(self, c: int) -> bool: left_ptr , right_ptr = 0 , int(c**0.5) while left_ptr <= right_ptr: cur = left_ptr**2 + right_ptr**2 if c == cur: return True elif c > cur: ...
class Solution: def judgeSquareSum(self, c: int) -> bool: left_ptr , right_ptr = 0 , int(c**0.5) while left_ptr <= right_ptr: cur = left_ptr**2 + right_ptr**2 if c == cur: return True elif c > cur: left_ptr += 1 else: ...
none
1
3.379284
3
PlateBridge/PlateBridge-simple-designVehicle-1stSpanMidSpan.py
ming91915/PlateBridge
1
6632304
# -*- coding: mbcs -*- # # Abaqus/CAE Release 6.14-1 # Internal Version: 2014_06_05-06.11.02 134264 # Run by eamdf on Tue Aug 21 16:58:48 2018 # # from driverUtils import executeOnCaeGraphicsStartup # executeOnCaeGraphicsStartup() #: Executing "onCaeGraphicsStartup()" in the site directory ... from abaqus import * fr...
# -*- coding: mbcs -*- # # Abaqus/CAE Release 6.14-1 # Internal Version: 2014_06_05-06.11.02 134264 # Run by eamdf on Tue Aug 21 16:58:48 2018 # # from driverUtils import executeOnCaeGraphicsStartup # executeOnCaeGraphicsStartup() #: Executing "onCaeGraphicsStartup()" in the site directory ... from abaqus import * fr...
en
0.50331
# -*- coding: mbcs -*- # # Abaqus/CAE Release 6.14-1 # Internal Version: 2014_06_05-06.11.02 134264 # Run by eamdf on Tue Aug 21 16:58:48 2018 # # from driverUtils import executeOnCaeGraphicsStartup # executeOnCaeGraphicsStartup() #: Executing "onCaeGraphicsStartup()" in the site directory ... #create model #create ske...
1.647836
2
website/views/registry.py
jrdbnntt-com/com_jrdbnntt_wedding
0
6632305
<filename>website/views/registry.py from django.http.request import HttpRequest from django.shortcuts import render def index(request: HttpRequest): return render(request, "registry/index.html", { 'page_title': 'Registry' })
<filename>website/views/registry.py from django.http.request import HttpRequest from django.shortcuts import render def index(request: HttpRequest): return render(request, "registry/index.html", { 'page_title': 'Registry' })
none
1
1.874302
2
data-science-in-python/introduction_to_data_science_in_python/pandas_csv_census1.py
ysoftman/test_code
3
6632306
# -*- coding: utf-8 -*- # author: ysoftman # python version : 3.x # desc : pandas test import numpy as np import pandas as pd print("load census.csv ... ") print() # csv 파일 읽기 df = pd.read_csv('census.csv') print("df.head()=\n", df.head(), sep="") print() # 컬럼 이름들 print(df.columns) print() # SUMLEV 컬럼의 유니크값 # SUML...
# -*- coding: utf-8 -*- # author: ysoftman # python version : 3.x # desc : pandas test import numpy as np import pandas as pd print("load census.csv ... ") print() # csv 파일 읽기 df = pd.read_csv('census.csv') print("df.head()=\n", df.head(), sep="") print() # 컬럼 이름들 print(df.columns) print() # SUMLEV 컬럼의 유니크값 # SUML...
ko
0.995884
# -*- coding: utf-8 -*- # author: ysoftman # python version : 3.x # desc : pandas test # csv 파일 읽기 # 컬럼 이름들 # SUMLEV 컬럼의 유니크값 # SUMLEV(Summary Level) 인구 통계청에서 지역구분에 쓰는 코드다 # 040 : state # 050 : county # 140 : census trac # 참고 https://blog.cubitplanning.com/2011/03/census-summary-level-sumlev/ # SUMLEV == 50 인 데이터만 남기기 ...
3.2833
3
master/main.py
agarwalsiddhant10/cluster-middleware
0
6632307
<filename>master/main.py import argparse import multiprocessing as mp import os import os.path import pickle import select import socket import time import copy from . import message_handlers from ..messaging import message from ..messaging import messageutils from ..messaging import network_params from . import prior...
<filename>master/main.py import argparse import multiprocessing as mp import os import os.path import pickle import select import socket import time import copy from . import message_handlers from ..messaging import message from ..messaging import messageutils from ..messaging import network_params from . import prior...
en
0.685536
# SERVER_SEND_PORT = 5005 # SERVER_RECV_PORT = 5006 # seconds # seconds # seconds # seconds Print a welcome message read from prompt_welcome file to stdout. # prompt_welcome_filepath = \ # os.path.dirname(os.path.realpath(__file__)) + "CLUSTER_MIDDLEWARE" # with open(prompt_welcome_filepath, 'r') as file: # pri...
2.403162
2
cinder/tests/unit/test_migrations.py
aarunsai81/netapp
11
6632308
# 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 # d...
# 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 # d...
en
0.811326
# 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 # d...
1.985947
2
hallo/modules/subscriptions/subscription_factory.py
joshcoales/Hallo
1
6632309
from typing import List, Type, Dict, TYPE_CHECKING import hallo.modules.subscriptions.subscription_exception from hallo.destination import Destination import hallo.modules.subscriptions.common_fa_key import hallo.modules.subscriptions.subscription_common import hallo.modules.subscriptions.subscription import hallo.mod...
from typing import List, Type, Dict, TYPE_CHECKING import hallo.modules.subscriptions.subscription_exception from hallo.destination import Destination import hallo.modules.subscriptions.common_fa_key import hallo.modules.subscriptions.subscription_common import hallo.modules.subscriptions.subscription import hallo.mod...
none
1
2.060347
2
runway/sources/git.py
avosper-intellaegis/runway
0
6632310
"""'Git type Path Source.""" import logging import shutil import subprocess import tempfile from pathlib import Path from typing import Any, Dict, Optional from .source import Source LOGGER = logging.getLogger(__name__) class Git(Source): """Git Path Source. The Git path source can be tasked with cloning a...
"""'Git type Path Source.""" import logging import shutil import subprocess import tempfile from pathlib import Path from typing import Any, Dict, Optional from .source import Source LOGGER = logging.getLogger(__name__) class Git(Source): """Git Path Source. The Git path source can be tasked with cloning a...
en
0.793959
'Git type Path Source. Git Path Source. The Git path source can be tasked with cloning a remote repository and pointing to a specific module folder (or the root). Git Path Source. Args: arguments: A reference can be passed along via the arguments so that a specific version ...
2.704262
3
app.py
tristanmkernan/off-the-beaten-path-backend
1
6632311
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import func from flask_cors import CORS from jsonschema import validate from geopy import Point from geopy.distance import vincenty import cloudinary import cloudinary.uploader import cloudinary.api from datetime i...
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import func from flask_cors import CORS from jsonschema import validate from geopy import Point from geopy.distance import vincenty import cloudinary import cloudinary.uploader import cloudinary.api from datetime i...
en
0.891353
#", # location should be in format `lat,lng` # attempt to find an existing location # check for results created today # naively create a target between MIN to MAX m away from current location
2.181265
2
distancemap.py
quinpallet/distance-map
0
6632312
<reponame>quinpallet/distance-map<filename>distancemap.py import folium import unicodedata from geopy.distance import great_circle as distance from q_geocode import ReverseGeocode def get_tooltip(location: tuple) -> str: return f'緯度:{location[0]}, 経度:{location[1]}' def get_marker_icon(label: str) -> folium.DivIc...
import folium import unicodedata from geopy.distance import great_circle as distance from q_geocode import ReverseGeocode def get_tooltip(location: tuple) -> str: return f'緯度:{location[0]}, 経度:{location[1]}' def get_marker_icon(label: str) -> folium.DivIcon: # マーカ文字サイズ font_size = 16 # 文字数取得(半角1、全角2)...
ja
0.998082
# マーカ文字サイズ # 文字数取得(半角1、全角2) # マーカアイコンの表示サイズ # マーカHTMLスタイル # 2点間座標の緯度中間座標を取得 # 2点間座標の経度中間座標を取得 # 始点座標住所表示 # 終点座標住所表示 # 直線距離表示
2.798299
3
venv/Lib/site-packages/cryptography/x509/base.py
arnoyu-hub/COMP0016miemie
0
6632313
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import abc import datetime import os import typing from cryptography import utils from cryptography.hazmat.bindings._rust impo...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import abc import datetime import os import typing from cryptography import utils from cryptography.hazmat.bindings._rust impo...
en
0.791107
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. # This is quadratic in the number of extensions # This is quadratic in the number of attributes Normalizes a datetime to a naive datetime in...
2.039556
2
dfirtrack_artifacts/tests/artifacttype/test_artifacttype_models.py
blackhatethicalhacking/dfirtrack
4
6632314
<reponame>blackhatethicalhacking/dfirtrack from django.test import TestCase from dfirtrack_artifacts.models import Artifacttype class ArtifacttypeModelTestCase(TestCase): """ artifacttype model tests """ @classmethod def setUpTestData(cls): # create object Artifacttype.objects.create(arti...
from django.test import TestCase from dfirtrack_artifacts.models import Artifacttype class ArtifacttypeModelTestCase(TestCase): """ artifacttype model tests """ @classmethod def setUpTestData(cls): # create object Artifacttype.objects.create(artifacttype_name = 'artifacttype_1') def ...
en
0.507676
artifacttype model tests # create object test string representation # get object # compare test attribute label # get object # get label # compare test attribute label # get object # get label # compare test attribute label # get object # get label # compare test attribute label # get object # get label # compare test ...
2.495126
2
python/test_controller.py
anyway-blows/uav_geometric_control
25
6632315
import numpy as np from controller import Dumbbell from kinematics import attitude angle = (2*np.pi- 0) * np.random.rand(1) + 0 # generate a random initial state that is outside of the asteroid pos = np.random.rand(3)+np.array([2,2,2]) R = attitude.rot1(angle).reshape(9) vel = np.random.rand(3) ang_vel = np.random.ra...
import numpy as np from controller import Dumbbell from kinematics import attitude angle = (2*np.pi- 0) * np.random.rand(1) + 0 # generate a random initial state that is outside of the asteroid pos = np.random.rand(3)+np.array([2,2,2]) R = attitude.rot1(angle).reshape(9) vel = np.random.rand(3) ang_vel = np.random.ra...
en
0.874716
# generate a random initial state that is outside of the asteroid Test the attitude controller for the inertial eoms
3.016088
3
proto2rapidjson/__main__.py
Sweetnow/Proto2RapidJSON
0
6632316
<filename>proto2rapidjson/__main__.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # *********************************************************************************** # * Copyright 2020-2021 <NAME>. All Rights Reserved. * # * Distributed under MIT license. ...
<filename>proto2rapidjson/__main__.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # *********************************************************************************** # * Copyright 2020-2021 <NAME>. All Rights Reserved. * # * Distributed under MIT license. ...
en
0.430597
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # *********************************************************************************** # * Copyright 2020-2021 <NAME>. All Rights Reserved. * # * Distributed under MIT license. * # * See file LICEN...
2.634394
3
locations/spiders/vetco_clinic.py
nbeecher/alltheplaces
0
6632317
<reponame>nbeecher/alltheplaces<gh_stars>0 # -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem from scrapy.selector import Selector class VetcoSpider(scrapy.Spider): name = "vetco" item_attributes = {'brand': "vetcoclinics"} allowed_domains = ["vetcoc...
# -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem from scrapy.selector import Selector class VetcoSpider(scrapy.Spider): name = "vetco" item_attributes = {'brand': "vetcoclinics"} allowed_domains = ["vetcoclinics.com"] start_urls = ( 'ht...
en
0.589017
# -*- coding: utf-8 -*- # Ignore the header
2.827273
3
pyspikelib/decomposition_plots.py
lzrvch/pyspikelib
3
6632318
<reponame>lzrvch/pyspikelib # PySpikeLib: A set of tools for neuronal spiking data mining # Copyright (c) 2020 <NAME>. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the L...
# PySpikeLib: A set of tools for neuronal spiking data mining # Copyright (c) 2020 <NAME>. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) ...
en
0.759938
# PySpikeLib: A set of tools for neuronal spiking data mining # Copyright (c) 2020 <NAME>. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) ...
2.321233
2
tests/test_seg_text.py
ffreemt/seg-text
0
6632319
"""Test seg_text.""" import pytest from seg_text.seg_text import seg_text def test_seg_text1(): """Test seg_text 1.""" text = " text 1\n\n test 2. test 3" _ = seg_text(text) assert len(_) == 2 text = " text 1\n\n test 2. Test 3" _ = seg_text(text) assert len(_) == 3 @pytest.mark.paramet...
"""Test seg_text.""" import pytest from seg_text.seg_text import seg_text def test_seg_text1(): """Test seg_text 1.""" text = " text 1\n\n test 2. test 3" _ = seg_text(text) assert len(_) == 2 text = " text 1\n\n test 2. Test 3" _ = seg_text(text) assert len(_) == 3 @pytest.mark.paramet...
zh
0.844246
Test seg_text. Test seg_text 1. Test blanks. Test semicolon. “元宇宙”,英文為“Metaverse”。該詞出自1992年;的科幻小說《雪崩》。 Test semicolon. “元宇宙”,英文為“Metaverse”。該詞出自1992年;的科幻小說《雪崩》。
2.970715
3
rpi1/scripts/controllers/CPUTemp.py
mkeshita/bachelor_degree_thesis
1
6632320
<reponame>mkeshita/bachelor_degree_thesis # -*- coding: utf-8 -*- class CPUTemp: def __init__(self, temp_file_path="/sys/class/thermal/thermal_zone0/temp"): self.temp_file_path = temp_file_path def __enter__(self): self.open() return self def open(self): """Opens file with...
# -*- coding: utf-8 -*- class CPUTemp: def __init__(self, temp_file_path="/sys/class/thermal/thermal_zone0/temp"): self.temp_file_path = temp_file_path def __enter__(self): self.open() return self def open(self): """Opens file with rpi temperature from /sys""" self...
en
0.725217
# -*- coding: utf-8 -*- Opens file with rpi temperature from /sys Reads rpi self temperature from file Converts celsius degrees value to fahrenheit degrees value Returns temperature in celsius degrees Returns temperature in fahrenheit degrees Returns temperature (currently in celsius degrees) Closes file with rpi tempe...
3.36061
3
omega/fetcher/abstract_quotes_fetcher.py
zillionare/zeta
0
6632321
#!/usr/bin/env python # -*- coding: utf-8 -*- """This is a awesome python script!""" import datetime import importlib import logging from typing import List, Union, Optional import arrow import cfg4py import numpy as np from numpy.lib import recfunctions as rfn from omicron import cache from omicron.core.lang ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This is a awesome python script!""" import datetime import importlib import logging from typing import List, Union, Optional import arrow import cfg4py import numpy as np from numpy.lib import recfunctions as rfn from omicron import cache from omicron.core.lang ...
zh
0.828451
#!/usr/bin/env python # -*- coding: utf-8 -*- This is a awesome python script! # todo: check if implementor has implemented all the required methods # todo: check duplicates 按如下格式返回证券列表。 code display_name name start_date end_date type 000001.XSHE 平安银行 PAYH 1991-04-03 ...
2.383138
2
test_data/intermediate/unexpected/documentation/unexpected_documentation_elements/meta_model.py
aas-core-works/aas-core-codegen
5
6632322
<reponame>aas-core-works/aas-core-codegen<filename>test_data/intermediate/unexpected/documentation/unexpected_documentation_elements/meta_model.py<gh_stars>1-10 """ Do something. 0: An unexpected block quote. """ class Something: """ Represent something. 1: An unexpected block quote. """ ...
""" Do something. 0: An unexpected block quote. """ class Something: """ Represent something. 1: An unexpected block quote. """ something: str """ Capture something. 2: An unexpected block quote. """ def __init__(self, something: str) -> None: self....
en
0.808428
Do something. 0: An unexpected block quote. Represent something. 1: An unexpected block quote. Capture something. 2: An unexpected block quote. Do something. 3: An unexpected block quote.
2.67838
3
_GTW/_RST/_TOP/Dir.py
Tapyr/tapyr
6
6632323
<reponame>Tapyr/tapyr # -*- coding: utf-8 -*- # Copyright (C) 2012-2017 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package GTW.RST.TOP. # # This module is licensed under th...
# -*- coding: utf-8 -*- # Copyright (C) 2012-2017 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package GTW.RST.TOP. # # This module is licensed under the terms of the BSD 3-C...
en
0.356333
# -*- coding: utf-8 -*- # Copyright (C) 2012-2017 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package GTW.RST.TOP. # # This module is licensed under the terms of the BSD 3-C...
1.574257
2
tests/test_multiplesOf3Or5.py
janusson/codewars-katas
0
6632324
# multiplesOf3Or5.py """ If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in. Note: If the number is a multiple of both 3 and 5, only...
# multiplesOf3Or5.py """ If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in. Note: If the number is a multiple of both 3 and 5, only...
en
0.77756
# multiplesOf3Or5.py If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in. Note: If the number is a multiple of both 3 and 5, only cou...
4.124288
4
tests/test_model.py
heinrichreimer/targer-api
1
6632325
from typing import List from pytest import fixture from targer_api import ( ArgumentLabel, ArgumentTag, ArgumentSentence, ArgumentSentences ) @fixture def argument_label() -> ArgumentLabel: return ArgumentLabel.C_I @fixture def argument_tag(argument_label: ArgumentLabel) -> ArgumentTag: return Argumen...
from typing import List from pytest import fixture from targer_api import ( ArgumentLabel, ArgumentTag, ArgumentSentence, ArgumentSentences ) @fixture def argument_label() -> ArgumentLabel: return ArgumentLabel.C_I @fixture def argument_tag(argument_label: ArgumentLabel) -> ArgumentTag: return Argumen...
none
1
2.449685
2
Horan_Colby/email_validation-db/mysqlconnection.py
webguru001/Python-Django-Web
5
6632326
from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import text # Create a class that will give us an object that we can use to connect to a database class MySQLConnection(object): def __init__(self, app, db): config = { 'host': 'localhost', 'database': db, 'user': 'root', 'password': '', ...
from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import text # Create a class that will give us an object that we can use to connect to a database class MySQLConnection(object): def __init__(self, app, db): config = { 'host': 'localhost', 'database': db, 'user': 'root', 'password': '', ...
en
0.91618
# Create a class that will give us an object that we can use to connect to a database
3.30058
3
grading_scripts/format_grades.py
vardhman1996/473_grading_scripts
0
6632327
# grade formatting for cse 473 # author: <NAME> import os import sys import zipfile if len(sys.argv) != 3: print 'Usage: python format_grades.py <project number> <output directory>' exit() _, project_num, d = sys.argv if project_num not in ['0','1','2','3','4','5']: print 'Invalid project number. Must be ...
# grade formatting for cse 473 # author: <NAME> import os import sys import zipfile if len(sys.argv) != 3: print 'Usage: python format_grades.py <project number> <output directory>' exit() _, project_num, d = sys.argv if project_num not in ['0','1','2','3','4','5']: print 'Invalid project number. Must be ...
en
0.395345
# grade formatting for cse 473 # author: <NAME> # Project 0 output # Project 1 output # Project 2 output # Project 3 output # Project 4 output # Project 5 output
3.646508
4
2019-01/WeixinArticles/db_redis.py
authetic-x/Web_Scraping
0
6632328
from redis import StrictRedis from config import * from request import WeixinRequest from pickle import dumps, loads class RedisQueue(): def __init__(self): self.db = StrictRedis(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD) def add(self, request): if isinstance(request, WeixinReq...
from redis import StrictRedis from config import * from request import WeixinRequest from pickle import dumps, loads class RedisQueue(): def __init__(self): self.db = StrictRedis(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD) def add(self, request): if isinstance(request, WeixinReq...
none
1
2.660346
3
pyredis/pool.py
schlitzered/pyredis
43
6632329
from random import shuffle import threading from pyredis import commands from pyredis.client import Client, ClusterClient, HashClient, SentinelClient from pyredis.exceptions import * from pyredis.helper import ClusterMap class BasePool(object): """ Base Class for all other pools. All other pools inherit from...
from random import shuffle import threading from pyredis import commands from pyredis.client import Client, ClusterClient, HashClient, SentinelClient from pyredis.exceptions import * from pyredis.helper import ClusterMap class BasePool(object): """ Base Class for all other pools. All other pools inherit from...
en
0.732306
Base Class for all other pools. All other pools inherit from this base class. This class itself, cannot be used directly. :param database: Select which db should be used for this pool :type database: int :param password: Password used for authentication. If None, no authentication...
2.739195
3
config/local/grafana/dashboards/example.dashboard.py
m-lab/prometheus-support
12
6632330
from grafanalib.core import * dashboard = Dashboard( title='Frontend Stats2', refresh='', time=Time('now-12h', 'now'), rows=[ Row( height=Pixels(500), panels=[ Graph( title="Frontend QPS", dataSource='Prometheus', targets=[ Target( ...
from grafanalib.core import * dashboard = Dashboard( title='Frontend Stats2', refresh='', time=Time('now-12h', 'now'), rows=[ Row( height=Pixels(500), panels=[ Graph( title="Frontend QPS", dataSource='Prometheus', targets=[ Target( ...
none
1
1.687918
2
machine_learning/dimensionality_reduction/pca/tf_pca/pca_out_of_core_distributed_module/trainer/resnet.py
ryangillard/artificial_intelligence
4
6632331
<gh_stars>1-10 import tensorflow as tf class ResNet(object): """Class that contains methods that preprocess images through ResNet. Attributes: params: dict, user passed parameters. """ def __init__(self, params): """Initializes `ResNet` class instance. Args: param...
import tensorflow as tf class ResNet(object): """Class that contains methods that preprocess images through ResNet. Attributes: params: dict, user passed parameters. """ def __init__(self, params): """Initializes `ResNet` class instance. Args: params: dict, user p...
en
0.787358
Class that contains methods that preprocess images through ResNet. Attributes: params: dict, user passed parameters. Initializes `ResNet` class instance. Args: params: dict, user passed parameters. Gets ResNet layers from ResNet50 model. Args: input_shape: tuple, i...
3.051592
3
pymutation/pymutation.py
kajchang/pymutation
0
6632332
from functools import reduce from math import factorial def pymutation( elements: list, event: list, combination: bool = False ): if len(event) > len(elements): raise ValueError('event can\'t be longer than elements') cache = {} for condition in event: if cache.get(condition) ...
from functools import reduce from math import factorial def pymutation( elements: list, event: list, combination: bool = False ): if len(event) > len(elements): raise ValueError('event can\'t be longer than elements') cache = {} for condition in event: if cache.get(condition) ...
none
1
3.011166
3
src/services/solutionsService.py
Hiestaa/ml-bench
0
6632333
# -*- coding: utf8 -*- from __future__ import unicode_literals import logging from bson.objectid import ObjectId from baseService import Service """ # solutions collection Describes a solution computed by a solver to a problem, and contains stores performed as the algorithm was running and on the final solution all...
# -*- coding: utf8 -*- from __future__ import unicode_literals import logging from bson.objectid import ObjectId from baseService import Service """ # solutions collection Describes a solution computed by a solver to a problem, and contains stores performed as the algorithm was running and on the final solution all...
en
0.875162
# -*- coding: utf8 -*- # solutions collection Describes a solution computed by a solver to a problem, and contains stores performed as the algorithm was running and on the final solution allowing to draw chart and tables showing the relevance of each solution. Schema: * _id:ObjectId, id of the solution * proble...
2.673004
3
projetoBancoPoo/main.py
gfcarvalho2304/PythonExercicios
0
6632334
<gh_stars>0 from banco import Banco from cliente import Cliente from conta import ContaCorrente, ContaPoupanca banco = Banco() cliente1 = Cliente ('Gabriel', 32) cliente2 = Cliente('Tamires', 31) cliente3 = Cliente('<NAME>', 63) conta1 = ContaPoupanca(1111, 230489, 0) conta2 = ContaCorrente(2222, 111289, 0) conta3 =...
from banco import Banco from cliente import Cliente from conta import ContaCorrente, ContaPoupanca banco = Banco() cliente1 = Cliente ('Gabriel', 32) cliente2 = Cliente('Tamires', 31) cliente3 = Cliente('<NAME>', 63) conta1 = ContaPoupanca(1111, 230489, 0) conta2 = ContaCorrente(2222, 111289, 0) conta3 = ContaPoupan...
none
1
2.793387
3
nctuLab1/src/sender.py
CyCTW/NCTU-Computer-Network
0
6632335
<gh_stars>0 #!/usr/bin/env python import argparse from scapy.all import * # Import protocol from Protocol import Protocol # Set source and destination IP address (Task 3.) src_ip = '10.0.1.1' dst_ip = '10.0.1.2' # Set source and destination port (Task 3.) src_port = 1024 dst_port = 80 ''' Main function ''' def ma...
#!/usr/bin/env python import argparse from scapy.all import * # Import protocol from Protocol import Protocol # Set source and destination IP address (Task 3.) src_ip = '10.0.1.1' dst_ip = '10.0.1.2' # Set source and destination port (Task 3.) src_port = 1024 dst_port = 80 ''' Main function ''' def main(): # ...
en
0.67298
#!/usr/bin/env python # Import protocol # Set source and destination IP address (Task 3.) # Set source and destination port (Task 3.) Main function # Define IP header (Task 3.) # Define customized header (Task 3.) # Read file and store into list # Send packets # TCP connection - SYN / SYN-ACK # TCP connection - ACK (Ta...
3.215603
3
Core/Solvers/MTSSP/PRDP_Data_Processing.py
zztcok/SNAC_PSNAC
1
6632336
<filename>Core/Solvers/MTSSP/PRDP_Data_Processing.py import os import sys import pdb import itertools sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))) import MSSP.scenario_class as scenario_class class MTSSP_PRDP_Data_Processing: def __init__(self, model_data): ...
<filename>Core/Solvers/MTSSP/PRDP_Data_Processing.py import os import sys import pdb import itertools sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))) import MSSP.scenario_class as scenario_class class MTSSP_PRDP_Data_Processing: def __init__(self, model_data): ...
en
0.728954
## List of parameters to fix ## Time independent ##Set product ##Set stage_gate ## Set time step ##Set resource type ## Set resource_max ## Set GammaL ## Set GammaD ## Set duration ## Set trial cost ## Set resources required ## Set revenue_max ## Set Last Time Step ## Set Last Trial ##Calculate Success matrix ## Calcul...
2.081779
2
__main__.py
WillKenzie/CaptureTheFlagServer
0
6632337
<reponame>WillKenzie/CaptureTheFlagServer<gh_stars>0 from flask import Flask, abort, request, Response from faker import Faker fake = Faker('en_US') app = Flask(__name__) @app.route('/users') def users(): return("{{[for i in range(1000) {'email':fake.ascii_email(), 'password':fake.ascii()}]}}") @app.route('/datab...
from flask import Flask, abort, request, Response from faker import Faker fake = Faker('en_US') app = Flask(__name__) @app.route('/users') def users(): return("{{[for i in range(1000) {'email':fake.ascii_email(), 'password':fake.ascii()}]}}") @app.route('/database') def database(): if request.authorization ==...
none
1
2.492472
2
app/trading/game.py
SteffenRossberg/pomalu-ale-jiste
0
6632338
import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import rc from app.utility.logger import Logger from app.environment.enums import Actions from datetime import timedelta class Game: def __init__( self, stock_exchange, agent, ...
import torch import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import rc from app.utility.logger import Logger from app.environment.enums import Actions from datetime import timedelta class Game: def __init__( self, stock_exchange, agent, ...
none
1
2.633512
3
src/data_processing/interface/inline_print.py
kaderghal/ADNI_Data_processing
5
6632339
<reponame>kaderghal/ADNI_Data_processing #!/usr/bin/python import config.config_read as rsd import config.ColorPrompt as CP #------------------------------------------------------------------------------------------ # Display Data: to print data (Terminal) #------------------------------------------------------------...
#!/usr/bin/python import config.config_read as rsd import config.ColorPrompt as CP #------------------------------------------------------------------------------------------ # Display Data: to print data (Terminal) #------------------------------------------------------------------------------------------ def print...
en
0.21913
#!/usr/bin/python #------------------------------------------------------------------------------------------ # Display Data: to print data (Terminal) #------------------------------------------------------------------------------------------ #Subject | Sex (F/M) | Age [min, max]/mean(std) | MMSE [min...
2.339134
2
netcrafter/__init__.py
cj-atmoscape/netcrafter
0
6632340
from netcrafter.netcrafter import netcraft __ALL__ = ( 'netcraft' )
from netcrafter.netcrafter import netcraft __ALL__ = ( 'netcraft' )
none
1
1.123834
1
2021/day_06/solution.py
dandiez/AdventOfCode
0
6632341
<reponame>dandiez/AdventOfCode from collections import Counter, defaultdict from unittest import TestCase def read_input(filename="input"): with open(filename) as f: lines = [line.strip() for line in f.readlines() if line.strip()] inp = [int(val) for val in lines[0].split(',')] # parse here... re...
from collections import Counter, defaultdict from unittest import TestCase def read_input(filename="input"): with open(filename) as f: lines = [line.strip() for line in f.readlines() if line.strip()] inp = [int(val) for val in lines[0].split(',')] # parse here... return inp def part_1(inp): ...
en
0.817077
# parse here... Solve puzzle and connect part 1 with part 2 if needed. # part 1 # part 2
3.485162
3
src/constants.py
PIVX-Project/PET4L
9
6632342
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017-2019 Random.Zebra (https://github.com/random-zebra/) # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. import os from queue import Queue wqueue = Queue() # ty...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017-2019 Random.Zebra (https://github.com/random-zebra/) # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. import os from queue import Queue wqueue = Queue() # ty...
en
0.611553
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017-2019 Random.Zebra (https://github.com/random-zebra/) # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. # type: Queue[str] # 212 = d4 # minimum PIV/kB # (model na...
1.782812
2
atx/record/android_hooks.py
jamjven/ATX
1,132
6632343
# -*- coding: utf-8 -*- # An android event hook via getevent. # Only ABS_MT_POSITION_X(Y) events are handled. # # Basic input: TouchDown(D), TouchUp(U), TouchMove(M) # Basic timeouts: TouchPressTimeout(P), TouchFollowTimeout(F), TouchMoveStopTimeout(S) # guestures are defined as follows: # Tap/Touch/Click: DM?...
# -*- coding: utf-8 -*- # An android event hook via getevent. # Only ABS_MT_POSITION_X(Y) events are handled. # # Basic input: TouchDown(D), TouchUp(U), TouchMove(M) # Basic timeouts: TouchPressTimeout(P), TouchFollowTimeout(F), TouchMoveStopTimeout(S) # guestures are defined as follows: # Tap/Touch/Click: DM?...
en
0.776815
# -*- coding: utf-8 -*- # An android event hook via getevent. # Only ABS_MT_POSITION_X(Y) events are handled. # # Basic input: TouchDown(D), TouchUp(U), TouchMove(M) # Basic timeouts: TouchPressTimeout(P), TouchFollowTimeout(F), TouchMoveStopTimeout(S) # guestures are defined as follows: # Tap/Touch/Click: DM?UF # ...
2.725555
3
swexpert/d2/sw_5177.py
ruslanlvivsky/python-algorithm
3
6632344
# 이진 힙 test_cases = int(input()) for t in range(1, test_cases + 1): n = int(input()) nums = list(map(int, input().split())) heap = [0] for num in nums: heap.append(num) idx = len(heap) - 1 parent = idx // 2 while parent > 0: if heap[idx] < heap[parent]: ...
# 이진 힙 test_cases = int(input()) for t in range(1, test_cases + 1): n = int(input()) nums = list(map(int, input().split())) heap = [0] for num in nums: heap.append(num) idx = len(heap) - 1 parent = idx // 2 while parent > 0: if heap[idx] < heap[parent]: ...
none
1
3.073281
3
pylabs/lab1-4.py
Vizald/labs
0
6632345
from math import * arrayG = [] arrayF = [] arrayY = [] arrayA = [] arrayX = [] while True: a = int(input("Введите a:")) x = int(input("Введите x:")) number = int(input("Какую переменную ищем?(1-3; 1-G, 2-F, 3-Y): ")) step = int(input("Какой шаг?: ")) count = int(input("Сколько шагов?: ")) if n...
from math import * arrayG = [] arrayF = [] arrayY = [] arrayA = [] arrayX = [] while True: a = int(input("Введите a:")) x = int(input("Введите x:")) number = int(input("Какую переменную ищем?(1-3; 1-G, 2-F, 3-Y): ")) step = int(input("Какой шаг?: ")) count = int(input("Сколько шагов?: ")) if n...
none
1
3.724279
4
connect/cli/plugins/product/sync/params.py
maxipavlovic/connect-cli
0
6632346
# -*- coding: utf-8 -*- # This file is part of the Ingram Micro Cloud Blue Connect connect-cli. # Copyright (c) 2019-2021 Ingram Micro. All Rights Reserved. import json import re from collections import namedtuple from json.decoder import JSONDecodeError from tqdm import trange from openpyxl.styles import Alignment ...
# -*- coding: utf-8 -*- # This file is part of the Ingram Micro Cloud Blue Connect connect-cli. # Copyright (c) 2019-2021 Ingram Micro. All Rights Reserved. import json import re from collections import namedtuple from json.decoder import JSONDecodeError from tqdm import trange from openpyxl.styles import Alignment ...
en
0.760775
# -*- coding: utf-8 -*- # This file is part of the Ingram Micro Cloud Blue Connect connect-cli. # Copyright (c) 2019-2021 Ingram Micro. All Rights Reserved. # noqa: CCR001 # noqa: CCR001
2.001308
2
towhee/engine/task_queue.py
yanliang567/towhee
1
6632347
# Copyright 2021 Zilliz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# Copyright 2021 Zilliz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
en
0.853085
# Copyright 2021 Zilliz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
2.729226
3
examples/test_camera.py
Mavengers/smarthelmet
1
6632348
<filename>examples/test_camera.py<gh_stars>1-10 import cv2 import time cap = cv2.VideoCapture(0) while True: ret, img = cap.read() img = cv2.flip(img, -1) cv2.imshow("img", img) if cv2.waitKey(1) & 0xFF == 27: break cap.release() cv2.destroyAllWindows()
<filename>examples/test_camera.py<gh_stars>1-10 import cv2 import time cap = cv2.VideoCapture(0) while True: ret, img = cap.read() img = cv2.flip(img, -1) cv2.imshow("img", img) if cv2.waitKey(1) & 0xFF == 27: break cap.release() cv2.destroyAllWindows()
none
1
2.758761
3
blog/apps/comment/filters.py
panchaoco/blog-py
0
6632349
<reponame>panchaoco/blog-py # -*- coding: utf-8 -*- __author__ = 'panchao' import django_filters from .models import Comment class CommentFilter(django_filters.rest_framework.FilterSet): article_id = django_filters.NumberFilter(field_name='article_id', lookup_expr='exact') class Meta: model = Commen...
# -*- coding: utf-8 -*- __author__ = 'panchao' import django_filters from .models import Comment class CommentFilter(django_filters.rest_framework.FilterSet): article_id = django_filters.NumberFilter(field_name='article_id', lookup_expr='exact') class Meta: model = Comment fields = ['article...
en
0.769321
# -*- coding: utf-8 -*-
1.758359
2
back-end/grocerybot/spiders/albertheijn_spider.py
TvanSchagen/grocerybot
1
6632350
import scrapy import json from datetime import datetime as dt from grocerybot.items import create_grocery_bot_item from grocerybot.spiders.models.page_attributes import PageAttributes from grocerybot.helpers.weight_standardizer import WeightStandardizer def parse_json_response(response): # convert repsonse to js...
import scrapy import json from datetime import datetime as dt from grocerybot.items import create_grocery_bot_item from grocerybot.spiders.models.page_attributes import PageAttributes from grocerybot.helpers.weight_standardizer import WeightStandardizer def parse_json_response(response): # convert repsonse to js...
en
0.747312
# convert repsonse to json # self.logger.info('main: %s' % response.url) # select the json node where the categories are loaded # Visit only the product categories # from each category, extract the href # Find the lanes that correspond to filters - these are the ones containing links to subcategory requests # If no 'So...
2.61824
3