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/Fun API.py
Ansh-code398/alfred-discord-bot
0
6630851
<filename>src/Fun API.py from functools import lru_cache import nextcord as discord import os import aiohttp import asyncio from bs4 import BeautifulSoup import datetime import requests import urllib.parse from googlesearch import search import External_functions as ef def requirements(): return ["re"] def m...
<filename>src/Fun API.py from functools import lru_cache import nextcord as discord import os import aiohttp import asyncio from bs4 import BeautifulSoup import datetime import requests import urllib.parse from googlesearch import search import External_functions as ef def requirements(): return ["re"] def m...
none
1
2.549528
3
boats/urls.py
DonSelester/yachts
0
6630852
<filename>boats/urls.py from django.urls import path, re_path from . import views app_name = 'boats' urlpatterns = [ # /boats/ path('', views.IndexView, name='index'), # /boats/owner/id/ re_path(r'^owner/(?P<user_id_id>[0-9]+)/$', views.owner_profile, name='owner_profile'), # /boats/owner/addboat/...
<filename>boats/urls.py from django.urls import path, re_path from . import views app_name = 'boats' urlpatterns = [ # /boats/ path('', views.IndexView, name='index'), # /boats/owner/id/ re_path(r'^owner/(?P<user_id_id>[0-9]+)/$', views.owner_profile, name='owner_profile'), # /boats/owner/addboat/...
en
0.935955
# /boats/ # /boats/owner/id/ # /boats/owner/addboat/id/ # /boats/owner/crewcontract/id/ # /boats/owner/boat_info/id/ # /boats/renter/id/ # /boats/renter/id/rentcontract/id/ # /boats/register/ # /boats/login/ # /boats/logout/ # /boats/id/ # /boats/bay/ # /boats/bay/id/ # /boats/crew/ # /boats/crew/id/ # /boats/competiti...
2.061755
2
server/infrastructure/catalog_records/repositories.py
multi-coop/catalogage-donnees
0
6630853
<gh_stars>0 import uuid from typing import TYPE_CHECKING, Optional from sqlalchemy import Column, DateTime, ForeignKey, func, select from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.exc import NoResultFound from sqlalchemy.orm import relationship from server.domain.catalog_records.entities import Catal...
import uuid from typing import TYPE_CHECKING, Optional from sqlalchemy import Column, DateTime, ForeignKey, func, select from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.exc import NoResultFound from sqlalchemy.orm import relationship from server.domain.catalog_records.entities import CatalogRecord fro...
en
0.985275
# Managed by DB for better time consistency
2.568091
3
stringspair.py
mujeebishaque/WorkingWithPython
4
6630854
<gh_stars>1-10 sparta={0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', 20: 'twenty', 21: '...
sparta={0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', 20: 'twenty', 21: 'twentyone', 22:...
none
1
1.54975
2
python/hangman/hangman.py
sci-c0/exercism-learning
0
6630855
# Game status categories # Change the values as you see fit STATUS_WIN = "win" STATUS_LOSE = "lose" STATUS_ONGOING = "ongoing" UNKNOWN = '_' class Hangman: def __init__(self, word: str): self._remaining_guesses = 10 self.status = STATUS_ONGOING self._answer = word self._guess = ['_...
# Game status categories # Change the values as you see fit STATUS_WIN = "win" STATUS_LOSE = "lose" STATUS_ONGOING = "ongoing" UNKNOWN = '_' class Hangman: def __init__(self, word: str): self._remaining_guesses = 10 self.status = STATUS_ONGOING self._answer = word self._guess = ['_...
en
0.69838
# Game status categories # Change the values as you see fit
3.37835
3
072-assembler-2/casm.py
gynvael/stream
152
6630856
<reponame>gynvael/stream #!/usr/bin/python import sys import os import string import struct from enum import Enum class TokenTypes(Enum): LABEL_INDICATOR = 1 # : in label declaration. LITERAL_INT = 2 LITERAL_STR = 4 IDENTIFIER = 5 # Labels, etc. class OutputElement(Enum): LABEL = 1 class AsmException(Exc...
#!/usr/bin/python import sys import os import string import struct from enum import Enum class TokenTypes(Enum): LABEL_INDICATOR = 1 # : in label declaration. LITERAL_INT = 2 LITERAL_STR = 4 IDENTIFIER = 5 # Labels, etc. class OutputElement(Enum): LABEL = 1 class AsmException(Exception): pass class St...
en
0.460053
#!/usr/bin/python # : in label declaration. # Labels, etc. # TODO: maybe add more info on type # "asdf" # 0x1234 # 1234 # identyfikator # WS* : CNAME [WS* COMMENT] # WS* CNAME WS+ (ARG WS* [, WS* ARG])? WS* COMMENT? # WS* "#" WS* COMMENT # s.reset() #INT3 CC 8 - - - - - ...
2.864206
3
flask_db.py
apanshi/graphene_test
0
6630857
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_graphql import GraphQLView from graphene_sqlalchemy import SQLAlchemyObjectType import graphene app = Flask(__name__) SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://test:test@192.168.1.2:3306/study?charset=utf8' app.config['SQLALCHEMY_DATABASE_URI'...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_graphql import GraphQLView from graphene_sqlalchemy import SQLAlchemyObjectType import graphene app = Flask(__name__) SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://test:test@192.168.1.2:3306/study?charset=utf8' app.config['SQLALCHEMY_DATABASE_URI'...
en
0.265849
# SQLAlchemy query # SQLAlchemy query
2.80415
3
pyvim/editor.py
lieryan/pyvim
0
6630858
""" The main editor class. Usage:: files_to_edit = ['file1.txt', 'file2.py'] e = Editor(files_to_edit) e.run() # Runs the event loop, starts interaction. """ from __future__ import unicode_literals from prompt_toolkit.application import Application from prompt_toolkit.buffer import Buffer from prompt_to...
""" The main editor class. Usage:: files_to_edit = ['file1.txt', 'file2.py'] e = Editor(files_to_edit) e.run() # Runs the event loop, starts interaction. """ from __future__ import unicode_literals from prompt_toolkit.application import Application from prompt_toolkit.buffer import Buffer from prompt_to...
en
0.724406
The main editor class. Usage:: files_to_edit = ['file1.txt', 'file2.py'] e = Editor(files_to_edit) e.run() # Runs the event loop, starts interaction. The main class. Containing the whole editor. :param config_directory: Place where configuration is stored. :param input: (Optionally) `prompt_tool...
2.836896
3
mayan/apps/acls/migrations/0003_auto_20180402_0339.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
2
6630859
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('acls', '0002_auto_20150703_0513'), ] operations = [ migrations.AlterModelOptions( name='accesscontrollist', options={ 'ordering': ('pk',), 'verbos...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('acls', '0002_auto_20150703_0513'), ] operations = [ migrations.AlterModelOptions( name='accesscontrollist', options={ 'ordering': ('pk',), 'verbos...
none
1
1.49669
1
app/__init__.py
calcutec/flask-burtonblog
0
6630860
import os from flask.ext.socketio import SocketIO from .momentjs import momentjs from flask import Flask from jinja2 import FileSystemLoader from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.mail import Mail from flask.ext.assets import Environment, Bundle from config i...
import os from flask.ext.socketio import SocketIO from .momentjs import momentjs from flask import Flask from jinja2 import FileSystemLoader from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.mail import Mail from flask.ext.assets import Environment, Bundle from config i...
en
0.882797
# Now these are equivalent: # monkey patching is necessary because this application uses a background # thread
2.029605
2
lsp/lwm2m_object.py
MoatyX/lwm2m-objects-generator
1
6630861
<filename>lsp/lwm2m_object.py import xml.etree.ElementTree as ET import lsp.util from lsp.lwm2m_resource import Lwm2mResource class Lwm2mObject: def __init__(self, xml_path: str): self.xml_path = xml_path self.RESOURCES = [] self.MULTI_INSTANCE = None self.RES_COUNT = None ...
<filename>lsp/lwm2m_object.py import xml.etree.ElementTree as ET import lsp.util from lsp.lwm2m_resource import Lwm2mResource class Lwm2mObject: def __init__(self, xml_path: str): self.xml_path = xml_path self.RESOURCES = [] self.MULTI_INSTANCE = None self.RES_COUNT = None ...
en
0.780448
# LWM2M(actual root) -> OBJECT(use this as the "root")
2.477866
2
xmas-requests/script.py
lhzaccarelli/thm-scripts
1
6630862
<reponame>lhzaccarelli/thm-scripts<gh_stars>1-10 import requests #Host on port 3000 host = "http://10.10.169.100:3000/" #Original path / path = "" #Variable for flag flag = "" print ("Running") #Run the script while path is not equal to 'end' while (path != "end"): #Get request to server response = requests.get(ho...
import requests #Host on port 3000 host = "http://10.10.169.100:3000/" #Original path / path = "" #Variable for flag flag = "" print ("Running") #Run the script while path is not equal to 'end' while (path != "end"): #Get request to server response = requests.get(host+path) #Convert the response to json json = ...
en
0.803653
#Host on port 3000 #Original path / #Variable for flag #Run the script while path is not equal to 'end' #Get request to server #Convert the response to json #Get value and next path #Check if value is different to 'end' #Copy value char to the end of flag #When loop is over, print flag.
3.056008
3
wit_core/tests/test_http_server.py
LucasOliveiraS/wit-core
1
6630863
<filename>wit_core/tests/test_http_server.py import pytest from fastapi.testclient import TestClient from wit_core.api.http_server import app client = TestClient(app) def test_http_message_response(mocker): process_intent = mocker.patch("wit_core.api.http_server.process_intent", return_value="Message processed"...
<filename>wit_core/tests/test_http_server.py import pytest from fastapi.testclient import TestClient from wit_core.api.http_server import app client = TestClient(app) def test_http_message_response(mocker): process_intent = mocker.patch("wit_core.api.http_server.process_intent", return_value="Message processed"...
none
1
2.377831
2
ext/pixler/tools/tmx2bin.py
slembcke/GGJ20-template
2
6630864
import sys import struct import base64 import xml.etree.ElementTree filename = sys.argv[1] map = xml.etree.ElementTree.parse(filename).getroot() data = map.find('layer/data') data_u32 = base64.b64decode(data.text).strip() format = "{0}I".format(len(data_u32)/4) values = struct.unpack(format, data_u32) # TODO is the ...
import sys import struct import base64 import xml.etree.ElementTree filename = sys.argv[1] map = xml.etree.ElementTree.parse(filename).getroot() data = map.find('layer/data') data_u32 = base64.b64decode(data.text).strip() format = "{0}I".format(len(data_u32)/4) values = struct.unpack(format, data_u32) # TODO is the ...
en
0.62787
# TODO is the padding weird?
2.189558
2
thaniya_server_archive/src/thaniya_server_archive/archive/BackupDataFile.py
jkpubsrc/Thaniya
1
6630865
<reponame>jkpubsrc/Thaniya<filename>thaniya_server_archive/src/thaniya_server_archive/archive/BackupDataFile.py import typing import re import time import os import random import jk_utils import jk_json # # This class represents a backup data file. Backup data files form the main data content of a backup. # c...
import typing import re import time import os import random import jk_utils import jk_json # # This class represents a backup data file. Backup data files form the main data content of a backup. # class BackupDataFile(object): ###################################################################################...
de
0.809024
# # This class represents a backup data file. Backup data files form the main data content of a backup. # ################################################################################################################################ ## Constructors #####################################################################...
2.757348
3
list/3.py
EmilianStoyanov/python_exercises_practice_solution
0
6630866
def max_num_in_list(items): tot = max(items) return tot print(max_num_in_list([1, 2, -8, 0])) # # def max_num_in_list(list): # max = list[0] # for a in list: # if a > max: # max = a # return max # # # print(max_num_in_list([1, 2, -8, 0])) """ Write a Python program to get the...
def max_num_in_list(items): tot = max(items) return tot print(max_num_in_list([1, 2, -8, 0])) # # def max_num_in_list(list): # max = list[0] # for a in list: # if a > max: # max = a # return max # # # print(max_num_in_list([1, 2, -8, 0])) """ Write a Python program to get the...
en
0.672429
# # def max_num_in_list(list): # max = list[0] # for a in list: # if a > max: # max = a # return max # # # print(max_num_in_list([1, 2, -8, 0])) Write a Python program to get the largest number from a list. Go to the editor
4.397749
4
compression/compress.py
oxixes/bad-apple-cg50
1
6630867
import numpy as np import cv2 import math import sys if len(sys.argv) < 2: print("Usage: compress.py [video]") print("Note: video must have a resolution lower than or equal to 384x216 px.") exit() totalBytes = 0 video = cv2.VideoCapture(sys.argv[1]) frameCount = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) w...
import numpy as np import cv2 import math import sys if len(sys.argv) < 2: print("Usage: compress.py [video]") print("Note: video must have a resolution lower than or equal to 384x216 px.") exit() totalBytes = 0 video = cv2.VideoCapture(sys.argv[1]) frameCount = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) w...
ja
0.125969
#{frameCounter} -> {len(rep) * 2} + 3 bytes")
2.952041
3
lib/galaxy/model/view/utils.py
maikenp/galaxy
1
6630868
""" View wrappers """ from inspect import getmembers from sqlalchemy import ( Column, MetaData, Table, ) from sqlalchemy.ext import compiler from sqlalchemy.schema import DDLElement class View: """Base class for Views.""" @staticmethod def _make_table(name, selectable, pkeys): """ Cr...
""" View wrappers """ from inspect import getmembers from sqlalchemy import ( Column, MetaData, Table, ) from sqlalchemy.ext import compiler from sqlalchemy.schema import DDLElement class View: """Base class for Views.""" @staticmethod def _make_table(name, selectable, pkeys): """ Cr...
en
0.860576
View wrappers Base class for Views. Create a view. :param name: The name of the view. :param selectable: SQLAlchemy selectable. :param pkeys: set of primary keys for the selectable. # We do not use the metadata object from model.mapping.py that contains all the Table objects # because that woul...
2.656724
3
scripts/set_sample_data.py
CM-haruna-oka/serverlss-etl-sample
0
6630869
import boto3 import yaml with open('scripts/config.yml', 'r') as yml: config = yaml.safe_load(yml) DEVICES_TABLE_NAME = 'Devices' def set_test_data(table_name, data): dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(table_name) for i in data: table.put_item(Item=i) set_test_data...
import boto3 import yaml with open('scripts/config.yml', 'r') as yml: config = yaml.safe_load(yml) DEVICES_TABLE_NAME = 'Devices' def set_test_data(table_name, data): dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(table_name) for i in data: table.put_item(Item=i) set_test_data...
none
1
2.213918
2
tests/backend/mongodb/test_admin.py
ldmberman/bigchaindb
0
6630870
"""Tests for the :mod:`bigchaindb.backend.mongodb.admin` module.""" import copy from unittest import mock import pytest from pymongo.database import Database from pymongo.errors import OperationFailure @pytest.fixture def mock_replicaset_config(): return { 'config': { '_id': 'bigchain-rs', ...
"""Tests for the :mod:`bigchaindb.backend.mongodb.admin` module.""" import copy from unittest import mock import pytest from pymongo.database import Database from pymongo.errors import OperationFailure @pytest.fixture def mock_replicaset_config(): return { 'config': { '_id': 'bigchain-rs', ...
en
0.871185
Tests for the :mod:`bigchaindb.backend.mongodb.admin` module. # connection is a lazy object. It only actually creates a connection to # the database when its first used. # During the setup of a MongoDBConnection some `Database.command` are # executed to make sure that the replica set is correctly initialized. # Here we...
2.406196
2
tests/integration/test_cpt.py
POFK/LensFinder
0
6630871
#!/usr/bin/env python # coding=utf-8 import torch from torch import nn from torch.utils.data import Dataset, DataLoader from torchvision import transforms import torch.nn.functional as F from lens.checkpoint import save, load import unittest from unittest import mock class TestCpt(unittest.TestCase): """Checkp...
#!/usr/bin/env python # coding=utf-8 import torch from torch import nn from torch.utils.data import Dataset, DataLoader from torchvision import transforms import torch.nn.functional as F from lens.checkpoint import save, load import unittest from unittest import mock class TestCpt(unittest.TestCase): """Checkp...
en
0.531213
#!/usr/bin/env python # coding=utf-8 Checkpoint test # torch_save.assert_called_once_with(save_dict, path)
2.50343
3
website/ttkom/forms.py
CharlesRigal/projet_website
0
6630872
<reponame>CharlesRigal/projet_website from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import Comment class ChangeForm(UserChangeForm): password = None class Meta: model = User fields = ("u...
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import Comment class ChangeForm(UserChangeForm): password = None class Meta: model = User fields = ("username", "first_name", "last_name", "...
none
1
2.257729
2
tests/test_mock.py
SuminAndrew/tornado-mocked-httpclient
7
6630873
# coding=utf-8 from tornado.httpclient import AsyncHTTPClient from tornado.testing import AsyncHTTPTestCase from tornado.web import Application, asynchronous, RequestHandler from tornado_mock.httpclient import get_response_stub, patch_http_client, set_stub class TestHandler(RequestHandler): @asynchronous de...
# coding=utf-8 from tornado.httpclient import AsyncHTTPClient from tornado.testing import AsyncHTTPTestCase from tornado.web import Application, asynchronous, RequestHandler from tornado_mock.httpclient import get_response_stub, patch_http_client, set_stub class TestHandler(RequestHandler): @asynchronous de...
en
0.88212
# coding=utf-8 # Test that mock for GET request is not used
2.38616
2
app/badges.py
AstroAntics/throat
0
6630874
""" Here we store badges. """ from .storage import FILE_NAMESPACE, mtype_from_file, calculate_file_hash, store_file from peewee import JOIN from .models import Badge, UserMetadata, SubMod from flask_babel import lazy_gettext as _l import uuid class Badges: """ Badge exposes a stable API for dealing with user ...
""" Here we store badges. """ from .storage import FILE_NAMESPACE, mtype_from_file, calculate_file_hash, store_file from peewee import JOIN from .models import Badge, UserMetadata, SubMod from flask_babel import lazy_gettext as _l import uuid class Badges: """ Badge exposes a stable API for dealing with user ...
en
0.926951
Here we store badges. Badge exposes a stable API for dealing with user badges. We need to be able to look up a badge by id and name, along with the ability to iterate through all of the badges. We also want to be able to create badges. For backwards compatability we will allow "fetching" of old_badge...
2.925529
3
Domain/models/GetPackagesDomainModel.py
arashmjr/ClubHouseFollowers
0
6630875
class GetPackagesDomainModel: package_id: str package_name: str price: int def __init__(self, package_id: str, package_name: str, price: int): self.package_id = package_id self.package_name = package_name self.price = price def to_dict(self): return {"package_id":...
class GetPackagesDomainModel: package_id: str package_name: str price: int def __init__(self, package_id: str, package_name: str, price: int): self.package_id = package_id self.package_name = package_name self.price = price def to_dict(self): return {"package_id":...
none
1
2.801726
3
notebooks/drive-download-20190731T104457Z-001/20190710/20190710/code/dummy_02a/deeplab3_256x256_01/data.py
pyaf/severstal-steel-defect-detection
0
6630876
<reponame>pyaf/severstal-steel-defect-detection from common import * import pydicom # https://www.kaggle.com/adkarhe/dicom-images # https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/overview/resources # https://www.kaggle.com/abhishek/train-your-own-mask-rcnn # https://www.kaggle.com/c/siim-acr-pneumothora...
from common import * import pydicom # https://www.kaggle.com/adkarhe/dicom-images # https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/overview/resources # https://www.kaggle.com/abhishek/train-your-own-mask-rcnn # https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/98478#latest-568453 # ...
en
0.414767
# https://www.kaggle.com/adkarhe/dicom-images # https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/overview/resources # https://www.kaggle.com/abhishek/train-your-own-mask-rcnn # https://www.kaggle.com/c/siim-acr-pneumothorax-segmentation/discussion/98478#latest-568453 # Dataset Update: Non-annotated instances...
2.192083
2
oauthlib/oauth2/rfc6749/grant_types/implicit.py
ButchershopCreative/oauthlib
1
6630877
<filename>oauthlib/oauth2/rfc6749/grant_types/implicit.py<gh_stars>1-10 # -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import from oauthlib import common from oauthlib.common import log from oauthlib.uri_validate...
<filename>oauthlib/oauth2/rfc6749/grant_types/implicit.py<gh_stars>1-10 # -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import from oauthlib import common from oauthlib.common import log from oauthlib.uri_validate...
en
0.745231
# -*- coding: utf-8 -*- oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `Implicit Grant`_ The implicit grant type is used to obtain access tokens (it does not support the issuance of refresh tokens) and is optimized for public clients known to operate a particular redirection URI. ...
2.082274
2
jtr/load/ls2jtr.py
mitchelljeff/SUMMAD4.3
1
6630878
""" This script converts data from the SemEval-2007 Task 10 on English Lexical Substitution to the jtr format. """ import json import xmltodict import re import os def load_substitituons(path): subs = {} with open(path, "r") as f: for line in f.readlines()[1:]: splits = line.split(" :: ")...
""" This script converts data from the SemEval-2007 Task 10 on English Lexical Substitution to the jtr format. """ import json import xmltodict import re import os def load_substitituons(path): subs = {} with open(path, "r") as f: for line in f.readlines()[1:]: splits = line.split(" :: ")...
en
0.654081
This script converts data from the SemEval-2007 Task 10 on English Lexical Substitution to the jtr format. #038;") # fixme: not sure what is happening here # print("%s\t%s\t%s" % (id, word, context_masked)) # create snippet
2.761166
3
puma/helpers/testing/mixin/not_a_test_case_enum.py
gift-surg/puma
0
6630879
from enum import Enum class NotATestCaseEnum(Enum): """Base Enum to prevent a class with 'Test' in the name being detected as a TestCase""" __test__ = False
from enum import Enum class NotATestCaseEnum(Enum): """Base Enum to prevent a class with 'Test' in the name being detected as a TestCase""" __test__ = False
en
0.939194
Base Enum to prevent a class with 'Test' in the name being detected as a TestCase
2.268447
2
others/dp/dpl-2.py
c-yan/atcoder
1
6630880
from sys import setrecursionlimit setrecursionlimit(10 ** 6) N, *a = map(int, open(0).read().split()) M = 3001 INF = M * 10 ** 9 def f(l, r): i = l * M + r if dp[i] != INF: return dp[i] if l == r: dp[i] = a[l] return dp[i] dp[i] = max(a[l] - f(l + 1, r), a[r] - f(l, r - 1)) ...
from sys import setrecursionlimit setrecursionlimit(10 ** 6) N, *a = map(int, open(0).read().split()) M = 3001 INF = M * 10 ** 9 def f(l, r): i = l * M + r if dp[i] != INF: return dp[i] if l == r: dp[i] = a[l] return dp[i] dp[i] = max(a[l] - f(l + 1, r), a[r] - f(l, r - 1)) ...
none
1
2.480069
2
euler5.py
healyshane/Python-Scripts
0
6630881
<reponame>healyshane/Python-Scripts<filename>euler5.py #<NAME>, 25-FEB # 2,520 is the smallest number that can be divided by # each of the numbers from 1 to 10 without any # remainder. Write a Python program using for and # range to calculate the smallest positive number # that is evenly divisible by all of the num...
#<NAME>, 25-FEB # 2,520 is the smallest number that can be divided by # each of the numbers from 1 to 10 without any # remainder. Write a Python program using for and # range to calculate the smallest positive number # that is evenly divisible by all of the numbers # from 1 to 20. n = 0 y = 1 while y != 0: # ...
en
0.905703
#<NAME>, 25-FEB # 2,520 is the smallest number that can be divided by # each of the numbers from 1 to 10 without any # remainder. Write a Python program using for and # range to calculate the smallest positive number # that is evenly divisible by all of the numbers # from 1 to 20. # continue loop until y=0 # increase b...
3.959981
4
mydeep-lib/mydeep_api/dataset/image_path_column.py
flegac/deep-experiments
0
6630882
<gh_stars>0 import os from typing import Iterator, Tuple, List import cv2 from mydeep_api.dataset.column import Column from mydeep_api.tensor import Tensor from surili_core.workspace import Workspace class ImagePathColumn(Column): @staticmethod def from_folder_tree(path: str, shape: Tuple[int, int] = None):...
import os from typing import Iterator, Tuple, List import cv2 from mydeep_api.dataset.column import Column from mydeep_api.tensor import Tensor from surili_core.workspace import Workspace class ImagePathColumn(Column): @staticmethod def from_folder_tree(path: str, shape: Tuple[int, int] = None): ima...
none
1
2.67999
3
apps/modules/post/process/post.py
singod/flask-osroom
1
6630883
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : <NAME> from bson.objectid import ObjectId from flask import request from flask_babel import gettext from flask_login import current_user from apps.app import mdbs from apps.modules.post.process.post_statistical import post_pv from app...
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : <NAME> from bson.objectid import ObjectId from flask import request from flask_babel import gettext from flask_login import current_user from apps.app import mdbs from apps.modules.post.process.post_statistical import post_pv from app...
zh
0.740143
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : <NAME> # 不能同时使用fields 和 unwanted_fields # 获取指定用户的post # 如果category_id为None, 则获取全部分类文章 # 指定分类 # 默认文集
2.136978
2
src/bs_processors/utils/file_util.py
RaduW/bs-processors
1
6630884
""" Utilities for applying processors to files """ import shutil from fnmatch import fnmatch from typing import Callable, List, Any, Sequence from bs4 import BeautifulSoup import os from os import path, walk import logging import re _log = logging.getLogger("bs-processors") def process_directory(processor: Callable[...
""" Utilities for applying processors to files """ import shutil from fnmatch import fnmatch from typing import Callable, List, Any, Sequence from bs4 import BeautifulSoup import os from os import path, walk import logging import re _log = logging.getLogger("bs-processors") def process_directory(processor: Callable[...
en
0.665602
Utilities for applying processors to files Processes a directory with the specified processor * **processor**: a file processor * **parser_type**: processor 'html.parser', 'html', 'xml' ( BeautifulSoup parser) * **input_dir**: the input directory * **output_dir**: the output directory * **file_sele...
3.236342
3
Problemset/beautiful-arrangement-ii/beautiful-arrangement-ii.py
KivenCkl/LeetCode
7
6630885
# @Title: 优美的排列 II (Beautiful Arrangement II) # @Author: KivenC # @Date: 2018-08-05 20:45:40 # @Runtime: 88 ms # @Memory: N/A class Solution: def constructArray(self, n, k): """ :type n: int :type k: int :rtype: List[int] """ if n <= 1 or k < 1 or n <= k: ...
# @Title: 优美的排列 II (Beautiful Arrangement II) # @Author: KivenC # @Date: 2018-08-05 20:45:40 # @Runtime: 88 ms # @Memory: N/A class Solution: def constructArray(self, n, k): """ :type n: int :type k: int :rtype: List[int] """ if n <= 1 or k < 1 or n <= k: ...
en
0.331698
# @Title: 优美的排列 II (Beautiful Arrangement II) # @Author: KivenC # @Date: 2018-08-05 20:45:40 # @Runtime: 88 ms # @Memory: N/A :type n: int :type k: int :rtype: List[int]
3.011672
3
setup.py
sonthonaxrk/flexmock
0
6630886
import codecs try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='flexmock', version='0.10.4', author='<NAME>, <NAME>', author_email='<EMAIL>', url='http://flexmock.readthedocs.org', license='BSD License', py_modules=['flexmock...
import codecs try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='flexmock', version='0.10.4', author='<NAME>, <NAME>', author_email='<EMAIL>', url='http://flexmock.readthedocs.org', license='BSD License', py_modules=['flexmock...
none
1
1.473581
1
3 Multi Face Recognition using a WebCam.py
cyanamous/Computer-Vision-Playground
1
6630887
import cv2 video = cv2.VideoCapture(0) #Cascade face_cascade = cv2.CascadeClassifier("./haarcascade_frontalface_default.xml") a = 1 while True: a = a + 1 check, frame = video.read() print(frame) print(check) gray_img = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) faces= face_cas...
import cv2 video = cv2.VideoCapture(0) #Cascade face_cascade = cv2.CascadeClassifier("./haarcascade_frontalface_default.xml") a = 1 while True: a = a + 1 check, frame = video.read() print(frame) print(check) gray_img = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) faces= face_cas...
en
0.348867
#Cascade # x,y,w,h = faces[0] # img = cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),3)
2.895485
3
Code/hash-table/hashtable.py
abrusebas1997/CS-1.3-Core-Data-Structures
0
6630888
<filename>Code/hash-table/hashtable.py #!python from linkedlist import LinkedList class HashTable(object): def __init__(self, init_size=8): """Initialize this hash table with the given initial size.""" self.buckets = [LinkedList() for i in range(init_size)] self.size = 0 # Number of key...
<filename>Code/hash-table/hashtable.py #!python from linkedlist import LinkedList class HashTable(object): def __init__(self, init_size=8): """Initialize this hash table with the given initial size.""" self.buckets = [LinkedList() for i in range(init_size)] self.size = 0 # Number of key...
en
0.825442
#!python Initialize this hash table with the given initial size. # Number of key-value entries Return a formatted string representation of this hash table. Return a string representation of this hash table. Return the bucket index where the given key would be stored. Return the load factor, the ratio of number of entri...
4.082914
4
malaya/segmentation.py
ahmed3991/malaya
1
6630889
import json import re from functools import lru_cache from math import log10 from malaya.text.regex import _expressions from malaya.model.tf import Segmentation from malaya.path import PATH_PREPROCESSING, S3_PATH_PREPROCESSING from malaya.supervised import transformer as load_transformer from malaya.function import che...
import json import re from functools import lru_cache from math import log10 from malaya.text.regex import _expressions from malaya.model.tf import Segmentation from malaya.path import PATH_PREPROCESSING, S3_PATH_PREPROCESSING from malaya.supervised import transformer as load_transformer from malaya.function import che...
en
0.37357
Segment strings. Example, "sayasygkan negarasaya" -> "saya sygkan negara saya" Parameters ---------- strings : List[str] Returns ------- result: List[str] Load Segmenter class using viterbi algorithm. Parameters ---------- max_split_length: int, (de...
2.009169
2
Mundo1/021.py
eliascastrosousa/exerciciospythonmundo1
0
6630890
<filename>Mundo1/021.py # desafio 021 - faça um programa em python que abra e reproduza o audio de um arquivo em MP3. import pygame pygame.init() pygame.mixer.music.load('pedrapapel.mp3') pygame.mixer.music.play() while(pygame.mixer.music.get_busy()): pass
<filename>Mundo1/021.py # desafio 021 - faça um programa em python que abra e reproduza o audio de um arquivo em MP3. import pygame pygame.init() pygame.mixer.music.load('pedrapapel.mp3') pygame.mixer.music.play() while(pygame.mixer.music.get_busy()): pass
pt
0.960386
# desafio 021 - faça um programa em python que abra e reproduza o audio de um arquivo em MP3.
3.463248
3
rman_operators/__init__.py
N500/RenderManForBlender
5
6630891
<gh_stars>1-10 from . import rman_operators_printer from . import rman_operators_view3d from . import rman_operators_render from . import rman_operators_rib from . import rman_operators_nodetree from . import rman_operators_collections from . import rman_operators_editors from . import rman_operators_stylized from . im...
from . import rman_operators_printer from . import rman_operators_view3d from . import rman_operators_render from . import rman_operators_rib from . import rman_operators_nodetree from . import rman_operators_collections from . import rman_operators_editors from . import rman_operators_stylized from . import rman_opera...
none
1
1.148152
1
python/solar.py
patrickmoffitt/Local-Solar-Noon
1
6630892
<filename>python/solar.py # # Created by <NAME> on 2019-02-04. # from math import sin, trunc from time import gmtime, localtime, struct_time from datetime import datetime, timedelta, timezone class Solar: # Days since Jan 1, 2000 12:00 UT def epoch_2k_day(self, _query): q = _query tz = self.g...
<filename>python/solar.py # # Created by <NAME> on 2019-02-04. # from math import sin, trunc from time import gmtime, localtime, struct_time from datetime import datetime, timedelta, timezone class Solar: # Days since Jan 1, 2000 12:00 UT def epoch_2k_day(self, _query): q = _query tz = self.g...
en
0.755692
# # Created by <NAME> on 2019-02-04. # # Days since Jan 1, 2000 12:00 UT # System of equations based upon Fourier analysis of a large MICA data set. # Only valid from 2000 to 2050. # Equation Of Time (EOT) # minutes # Get the local offset from UTC. # Adjust EOT for longitude and timezone. # Format decimal minutes to ho...
2.880506
3
tests/unit/test_events.py
jgu2/jade
15
6630893
<reponame>jgu2/jade<filename>tests/unit/test_events.py """ Unit tests for job event object and methods """ import os from jade.events import ( StructuredLogEvent, StructuredErrorLogEvent, EventsSummary, EVENT_NAME_UNHANDLED_ERROR, ) def test_structured_event__create(): """Test class initialization...
""" Unit tests for job event object and methods """ import os from jade.events import ( StructuredLogEvent, StructuredErrorLogEvent, EventsSummary, EVENT_NAME_UNHANDLED_ERROR, ) def test_structured_event__create(): """Test class initialization and methods""" event = StructuredLogEvent( ...
en
0.857021
Unit tests for job event object and methods Test class initialization and methods Test class initialization and methods Should print tabular events in terminal
2.708672
3
stock_portfolio/models/stock.py
tyler-fishbone/new_stock_portfolio
0
6630894
<reponame>tyler-fishbone/new_stock_portfolio<gh_stars>0 from sqlalchemy import ( Column, Integer, String, DateTime, ForeignKey, ) from .meta import Base from sqlalchemy.orm import relationship from .association import association_table # need to change this to stock info class Stock(Base): __t...
from sqlalchemy import ( Column, Integer, String, DateTime, ForeignKey, ) from .meta import Base from sqlalchemy.orm import relationship from .association import association_table # need to change this to stock info class Stock(Base): __tablename__ = 'stocks' id = Column(Integer, primary_k...
en
0.948038
# need to change this to stock info
2.623194
3
mak-example/parse.py
ConnectedHomes/kafkatos3
6
6630895
<reponame>ConnectedHomes/kafkatos3 #!/usr/bin/env python import argparse import sys from kafkatos3.MessageArchiveKafka import MessageArchiveKafkaReader, MessageArchiveKafkaRecord, KafkaMessage def main(argv): parser = argparse.ArgumentParser(description='Example script to parse a MAK file', prog=argv[0]) pars...
#!/usr/bin/env python import argparse import sys from kafkatos3.MessageArchiveKafka import MessageArchiveKafkaReader, MessageArchiveKafkaRecord, KafkaMessage def main(argv): parser = argparse.ArgumentParser(description='Example script to parse a MAK file', prog=argv[0]) parser.add_argument('file', help='filen...
en
0.413593
#!/usr/bin/env python Zero-argument entry point for use with setuptools/distribute.
2.561564
3
backend/data/jimm/models/__init__.py
MikeOwino/JittorVis
139
6630896
from .efficientnet import * from .layers import * from .resnet import * from .resnetv2 import * from .vision_transformer import * from .vision_transformer_hybrid import * from .hrnet import * from .swin_transformer import * from .volo import *
from .efficientnet import * from .layers import * from .resnet import * from .resnetv2 import * from .vision_transformer import * from .vision_transformer_hybrid import * from .hrnet import * from .swin_transformer import * from .volo import *
none
1
1.02289
1
events/views.py
exenin/Django-CRM
0
6630897
<reponame>exenin/Django-CRM from datetime import date, datetime, timedelta from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import PermissionDenied from django.db.m...
from datetime import date, datetime, timedelta from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import PermissionDenied from django.db.models import Q from django.h...
en
0.518003
# context['status'] = status # context['status'] = status # recurring_days # recurring_days # recurring_days = request.POST.getlist('days') # event.created_by = request.user # event.contacts.add(*request.POST.getlist('contacts')) # event.assigned_to.add(*request.POST.getlist('assigned_to'))
1.844102
2
src/jodlgang/tensorwow/layers.py
fausecteam/faustctf-2018-jodlgang
4
6630898
<gh_stars>1-10 import numpy as np from tensorwow.im2col import im2col_indices class FullyConnectedLayer(object): def __init__(self, num_input_units, num_output_units, activation_func, weights_initializer, bias_initializer): """ :param num_input_units: Number of input dimensions D :param nu...
import numpy as np from tensorwow.im2col import im2col_indices class FullyConnectedLayer(object): def __init__(self, num_input_units, num_output_units, activation_func, weights_initializer, bias_initializer): """ :param num_input_units: Number of input dimensions D :param num_output_units:...
en
0.639939
:param num_input_units: Number of input dimensions D :param num_output_units: Number of output dimensions O :param activation_func: Activation function :param weights_initializer: Weights initializer :param bias_initializer: Bias initializer # Disable default initialization # self._weigh...
2.868278
3
output_visualisation_window.py
Lewak/PracaMagisterska
0
6630899
<filename>output_visualisation_window.py from generic_window import GenericWindow from dearpygui import core, simple from tensor_flow_interface import TensorFlowInterface class OutputVisualisationWindow(GenericWindow): heatMapTable = [[]] windowName = 'Wizualizacja wyjscia' learningGraph = 'Historia uczeni...
<filename>output_visualisation_window.py from generic_window import GenericWindow from dearpygui import core, simple from tensor_flow_interface import TensorFlowInterface class OutputVisualisationWindow(GenericWindow): heatMapTable = [[]] windowName = 'Wizualizacja wyjscia' learningGraph = 'Historia uczeni...
none
1
2.808195
3
skidl/alias.py
vkleen/skidl
700
6630900
<filename>skidl/alias.py # -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 <NAME>. """ Handles aliases for Circuit, Part, Pin, Net, Bus, Interface objects. """ from __future__ import ( # isort:skip absolute_import, division, print_function, unicode_literals, ) import re from...
<filename>skidl/alias.py # -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 <NAME>. """ Handles aliases for Circuit, Part, Pin, Net, Bus, Interface objects. """ from __future__ import ( # isort:skip absolute_import, division, print_function, unicode_literals, ) import re from...
en
0.675965
# -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 <NAME>. Handles aliases for Circuit, Part, Pin, Net, Bus, Interface objects. # isort:skip Multiple aliases can be added to another object to give it other names. Args: aliases: A single string or a list of strings. Add new aliases. R...
2.740757
3
service/service.py
sesam-community/currenttime
0
6630901
from flask import Flask, request, jsonify, Response from sesamutils import VariablesConfig, sesam_logger import json import requests import os import sys app = Flask(__name__) logger = sesam_logger("Steve the logger", app=app) ## Logic for running program in dev try: with open("helpers.json", "r") as stream: ...
from flask import Flask, request, jsonify, Response from sesamutils import VariablesConfig, sesam_logger import json import requests import os import sys app = Flask(__name__) logger = sesam_logger("Steve the logger", app=app) ## Logic for running program in dev try: with open("helpers.json", "r") as stream: ...
en
0.6444
## Logic for running program in dev ## ## Helper functions #else: # logger.info("Nothing to do... Look at the README or in the code to modify the if clauses.")
2.31585
2
odm/dialects/postgresql/__init__.py
quantmind/pulsar-odm
16
6630902
<filename>odm/dialects/postgresql/__init__.py from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2 from sqlalchemy.dialects import registry from .pool import GreenletPool class PGDGreen(PGDialect_psycopg2): '''PostgreSql dialect using psycopg2 and greenlet to obtain an implicit asynchronous...
<filename>odm/dialects/postgresql/__init__.py from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2 from sqlalchemy.dialects import registry from .pool import GreenletPool class PGDGreen(PGDialect_psycopg2): '''PostgreSql dialect using psycopg2 and greenlet to obtain an implicit asynchronous...
en
0.674078
PostgreSql dialect using psycopg2 and greenlet to obtain an implicit asynchronous database connection.
2.323011
2
tests/test_holding_groups.py
mscarey/AuthoritySpoke
18
6630903
<reponame>mscarey/AuthoritySpoke import pytest from authorityspoke.holdings import HoldingGroup class TestMakeHoldingGroup: def test_all_members_must_be_holdings(self, make_rule): with pytest.raises(TypeError): HoldingGroup([make_rule["h1"]]) class TestHoldingGroupImplies: def test_expl...
import pytest from authorityspoke.holdings import HoldingGroup class TestMakeHoldingGroup: def test_all_members_must_be_holdings(self, make_rule): with pytest.raises(TypeError): HoldingGroup([make_rule["h1"]]) class TestHoldingGroupImplies: def test_explain_holdinggroup_implication(self...
none
1
2.574925
3
uquake/grid/base.py
jeanphilippemercier/uquake
0
6630904
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Filename: <filename> # Purpose: <purpose> # Author: <author> # Email: <email> # # Copyright (C) <copyright> # -------------------------------------------------------------------- """ :copyright: <copyright> :licen...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Filename: <filename> # Purpose: <purpose> # Author: <author> # Email: <email> # # Copyright (C) <copyright> # -------------------------------------------------------------------- """ :copyright: <copyright> :licen...
en
0.68335
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Filename: <filename> # Purpose: <purpose> # Author: <author> # Email: <email> # # Copyright (C) <copyright> # -------------------------------------------------------------------- :copyright: <copyright> :license: ...
2.101055
2
__init__.py
pjcigan/obsplanning
1
6630905
<gh_stars>1-10 name="obsplanning"
name="obsplanning"
none
1
1.138966
1
example.py
whackur/pySeed128
4
6630906
<reponame>whackur/pySeed128<filename>example.py from kisaSeed.kisaSeed import * if __name__ == "__main__": text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sit amet ultrices purus. Integer " \ "cursus sit amet diam sagittis porttitor. Praesent viverra, erat at tincidunt ornare...
from kisaSeed.kisaSeed import * if __name__ == "__main__": text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sit amet ultrices purus. Integer " \ "cursus sit amet diam sagittis porttitor. Praesent viverra, erat at tincidunt ornare, mauris arcu " \ "dignissim leo, fau...
none
1
1.741
2
mediawatcher/__main__.py
adrien-f/mediawatcher
1
6630907
<filename>mediawatcher/__main__.py #!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import yaml from mediawatcher import MediaWatcher def main(): parser = argparse.ArgumentParser(description='Watch directories and move media files accordingly.') parser.add_argument('-c', dest='config', help='pa...
<filename>mediawatcher/__main__.py #!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import yaml from mediawatcher import MediaWatcher def main(): parser = argparse.ArgumentParser(description='Watch directories and move media files accordingly.') parser.add_argument('-c', dest='config', help='pa...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.484346
2
amethyst/tools/build_clang_commands/__main__.py
knight-ryu12/StarFoxAdventures
22
6630908
#!/usr/bin/env python3 """Asks `make` to output all commands it would run, and generates `compile_commands.json` from them. This file's purpose is to tell the VSCode clangd extension how to compile the files, so that it can do error checking, completion, etc. Note that the paths must be absolute, so you'll need to ru...
#!/usr/bin/env python3 """Asks `make` to output all commands it would run, and generates `compile_commands.json` from them. This file's purpose is to tell the VSCode clangd extension how to compile the files, so that it can do error checking, completion, etc. Note that the paths must be absolute, so you'll need to ru...
en
0.880428
#!/usr/bin/env python3 Asks `make` to output all commands it would run, and generates `compile_commands.json` from them. This file's purpose is to tell the VSCode clangd extension how to compile the files, so that it can do error checking, completion, etc. Note that the paths must be absolute, so you'll need to run t...
2.62578
3
gmqtt/mqtt/connection.py
rkrell/gmqtt
0
6630909
import asyncio import time from .protocol import MQTTProtocol class MQTTConnection(object): def __init__(self, transport: asyncio.Transport, protocol: MQTTProtocol, clean_session: bool, keepalive: int): self._transport = transport self._protocol = protocol self._protocol.set_connection(s...
import asyncio import time from .protocol import MQTTProtocol class MQTTConnection(object): def __init__(self, transport: asyncio.Transport, protocol: MQTTProtocol, clean_session: bool, keepalive: int): self._transport = transport self._protocol = protocol self._protocol.set_connection(s...
en
0.909834
# This is not blocking operation, because transport place the data # to the buffer, and this buffer flushing async
2.817048
3
piper/mayapy/rig/__init__.py
MongoWobbler/piper
0
6630910
# Copyright (c) 2021 <NAME>. All Rights Reserved. import os import time import inspect import pymel.core as pm import piper_config as pcfg import piper.core.util as pcu import piper.mayapy.util as myu import piper.mayapy.convert as convert import piper.mayapy.mayamath as mayamath import piper.mayapy.pipernode as pi...
# Copyright (c) 2021 <NAME>. All Rights Reserved. import os import time import inspect import pymel.core as pm import piper_config as pcfg import piper.core.util as pcu import piper.mayapy.util as myu import piper.mayapy.convert as convert import piper.mayapy.mayamath as mayamath import piper.mayapy.pipernode as pi...
en
0.796822
# Copyright (c) 2021 <NAME>. All Rights Reserved. Gets the root control associated with the given rig. Args: rig (pm.nodetypes.piperRig): Rig node to get root control of. Returns: (pm.nodetypes.DependNode): Root control of rig. Gets all the meshes inside all the piper skinned nodes in the sce...
2.182184
2
src/cool_compiler/error/error.py
matcom-school/cool-compiler-2021
0
6630911
<reponame>matcom-school/cool-compiler-2021 from cool_compiler.types.build_in_types import self class CoolError: def __init__(self, code : str) -> None: self._list = [] self.code = code self.pos = None self.text = None def any(self): if any(self._list): ...
from cool_compiler.types.build_in_types import self class CoolError: def __init__(self, code : str) -> None: self._list = [] self.code = code self.pos = None self.text = None def any(self): if any(self._list): for msg in self._list: pri...
none
1
2.805947
3
pyplusplus/code_creators/module.py
electronicvisions/pyplusplus
0
6630912
<reponame>electronicvisions/pyplusplus # Copyright 2004-2008 <NAME>. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os from . import custom from . import license from . import include from . import compound...
# Copyright 2004-2008 <NAME>. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os from . import custom from . import license from . import include from . import compound from . import namespace from . import ...
en
0.816409
# Copyright 2004-2008 <NAME>. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) This class represents the source code for the entire extension module. The root of the code creator tree is always a module_t object...
1.833047
2
boa3_test/test_sc/variable_test/AssignLocalWithArgument.py
hal0x2328/neo3-boa
25
6630913
<reponame>hal0x2328/neo3-boa<filename>boa3_test/test_sc/variable_test/AssignLocalWithArgument.py from boa3.builtin import public @public def Main(a: int) -> int: b = a return b
from boa3.builtin import public @public def Main(a: int) -> int: b = a return b
none
1
1.668443
2
niftyreg_python_utilities/apply_transform_dir.py
pritesh-mehta/niftyreg_python_utilities
0
6630914
<filename>niftyreg_python_utilities/apply_transform_dir.py """ @author: pritesh-mehta """ import os from argparse import ArgumentParser def apply_transform_dir(niftyreg_exe_dir, ref_dir, flo_dir, res_dir, trans_dir, param_str='-inter 1', extension='nii.gz'): '''Apply transform to flo_dir ''...
<filename>niftyreg_python_utilities/apply_transform_dir.py """ @author: pritesh-mehta """ import os from argparse import ArgumentParser def apply_transform_dir(niftyreg_exe_dir, ref_dir, flo_dir, res_dir, trans_dir, param_str='-inter 1', extension='nii.gz'): '''Apply transform to flo_dir ''...
en
0.584948
@author: pritesh-mehta Apply transform to flo_dir
2.476522
2
Lib/idlelib/idle_test/test_colorizer.py
askervin/cpython
1
6630915
"Test colorizer, coverage 93%." from idlelib import colorizer from test.support import requires import unittest from unittest import mock from functools import partial from tkinter import Tk, Text from idlelib import config from idlelib.percolator import Percolator usercfg = colorizer.idleConf.userCfg testcfg = { ...
"Test colorizer, coverage 93%." from idlelib import colorizer from test.support import requires import unittest from unittest import mock from functools import partial from tkinter import Tk, Text from idlelib import config from idlelib.percolator import Percolator usercfg = colorizer.idleConf.userCfg testcfg = { ...
en
0.859741
# keyword, builtin, string, comment\n" # 'string' in comment\n" # if in comment\n" # valid string-keyword no-space combinations\n" x # Tested in more detail by testing prog. # Uses IDLE Classic theme as default. # Delegator stack = [Delagator(text)] # Calls color.setdelagate(Delagator(text)). # The following are class ...
2.695267
3
fringes/main_window.py
drs251/fringes
2
6630916
<filename>fringes/main_window.py import numpy as np import time import pyqtgraph as pg from PyQt5.QtCore import pyqtSlot, pyqtSignal, qDebug, QRectF, QRect, Qt from PyQt5.QtWidgets import QMainWindow, QWidget, QHBoxLayout, QDialog, QGridLayout, QLabel, QDoubleSpinBox, QAction from ui.main_window import Ui_MainWindow f...
<filename>fringes/main_window.py import numpy as np import time import pyqtgraph as pg from PyQt5.QtCore import pyqtSlot, pyqtSignal, qDebug, QRectF, QRect, Qt from PyQt5.QtWidgets import QMainWindow, QWidget, QHBoxLayout, QDialog, QGridLayout, QLabel, QDoubleSpinBox, QAction from ui.main_window import Ui_MainWindow f...
zh
0.157011
# self.setWindowFlags(Qt.WindowStaysOnTopHint)
2.159931
2
level.py
Kedyn/SuperMario
0
6630917
<reponame>Kedyn/SuperMario<filename>level.py from tilemap import TileMap class Level: def __init__(self, file, screen): self.__tile_map = TileMap(file, screen) self.done = False def keydown(self, key): self.__tile_map.mario.keydown(key) def keyup(self, key): self.__tile_...
from tilemap import TileMap class Level: def __init__(self, file, screen): self.__tile_map = TileMap(file, screen) self.done = False def keydown(self, key): self.__tile_map.mario.keydown(key) def keyup(self, key): self.__tile_map.mario.keyup(key) def update(self): ...
none
1
2.81734
3
geometric_analysis.py
siorconsulting/nrip-jamaica-open-source
0
6630918
import os from utils import * import geopandas as gpd # import whitebox # wbt = whitebox.WhiteboxTools() wbt = wbt_setup(verbose=False) wokring_dir = wbt.work_dir __all__ = ['intersect', # NOT TESTED 'zonal_statistics', # NOT TESTED 'distance_from_points', # TESTED 'di...
import os from utils import * import geopandas as gpd # import whitebox # wbt = whitebox.WhiteboxTools() wbt = wbt_setup(verbose=False) wokring_dir = wbt.work_dir __all__ = ['intersect', # NOT TESTED 'zonal_statistics', # NOT TESTED 'distance_from_points', # TESTED 'di...
en
0.505044
# import whitebox # wbt = whitebox.WhiteboxTools() # NOT TESTED # NOT TESTED # TESTED # TESTED # TESTED # TESTED # TESTED # TESTED # TESTED # TESTED # NOT TESTED # NOT TESTED Function to return all feature parts that occur in both input layers Inputs: input_vector_file: str <-- path to vector(.shp) file...
2.902955
3
accountable/config.py
wohlgejm/accountable
2
6630919
import os try: from UserDict import UserDict except ImportError: from collections import UserDict import click import yaml from requests.auth import HTTPBasicAuth CONFIG_DIR = os.path.expanduser('~/.accountable') DEFAULT_ISSUE_FIELDS = [ {'reporter': 'displayName'}, {'assignee': 'displayName'}, ...
import os try: from UserDict import UserDict except ImportError: from collections import UserDict import click import yaml from requests.auth import HTTPBasicAuth CONFIG_DIR = os.path.expanduser('~/.accountable') DEFAULT_ISSUE_FIELDS = [ {'reporter': 'displayName'}, {'assignee': 'displayName'}, ...
none
1
2.324412
2
obsolete/parser/view_namespace.py
dina-fouad/pyccel
206
6630920
<filename>obsolete/parser/view_namespace.py def view_namespace(namespace, entry): """ Print contents of a namespace. Parameters ---------- namespace: dict Dictionary that represents the current namespace, usually attached to a BasicParser object. entry: ...
<filename>obsolete/parser/view_namespace.py def view_namespace(namespace, entry): """ Print contents of a namespace. Parameters ---------- namespace: dict Dictionary that represents the current namespace, usually attached to a BasicParser object. entry: ...
en
0.499163
Print contents of a namespace. Parameters ---------- namespace: dict Dictionary that represents the current namespace, usually attached to a BasicParser object. entry: str Key of interest. # TODO improve # txt = tabulate(table, headers, tablefmt="rst"...
3.311317
3
facebookApi/views.py
vladyslavnUA/client-dynamic
1
6630921
<gh_stars>1-10 from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.views.generic.edit import ( CreateView, UpdateView, DeleteView) import datetime from dateutil import parser from django.contrib.auth.models import User from django.shortcuts import re...
from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.views.generic.edit import ( CreateView, UpdateView, DeleteView) import datetime from dateutil import parser from django.contrib.auth.models import User from django.shortcuts import render, HttpRespo...
en
0.202904
# returns sum of an array # graph.page_positive_feedback_by_type() # if user.profile.fb_page_id != '' and user.profile.fb_page_token != '': # return HttpResponseRedirect(reverse('clients:dashboard', kwargs={'page_token': user.profile.fb_page_token, 'page_id':user.profile.fb_page_id })) # print("-------------------"...
2.153684
2
airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_source.py
heap/airbyte
22
6630922
<gh_stars>10-100 # # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # from abc import abstractmethod from typing import Tuple from airbyte_cdk.sources.abstract_source import AbstractSource from airbyte_cdk.sources.declarative.checks.connection_checker import ConnectionChecker class DeclarativeSource(Abstrac...
# # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # from abc import abstractmethod from typing import Tuple from airbyte_cdk.sources.abstract_source import AbstractSource from airbyte_cdk.sources.declarative.checks.connection_checker import ConnectionChecker class DeclarativeSource(AbstractSource): """...
en
0.835974
# # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # Base class for declarative Source. Concrete sources need to define the connection_checker to use
2.256166
2
kibble/scanners/scanners/git-sloc.py
jbampton/kibble
1
6630923
<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License")...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
en
0.872465
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.143491
2
quant/common/util.py
doubleDragon/QuantBot
7
6630924
#!/usr/bin/env python # -*- coding: UTF-8 -*- def convert_currency_bfx(currency): currency = currency.lower() if currency == "dash": currency = "dsh" if currency == "bcc": currency = "bch" if currency == "iota": currency = 'iot' return currency.upper()
#!/usr/bin/env python # -*- coding: UTF-8 -*- def convert_currency_bfx(currency): currency = currency.lower() if currency == "dash": currency = "dsh" if currency == "bcc": currency = "bch" if currency == "iota": currency = 'iot' return currency.upper()
fr
0.146266
#!/usr/bin/env python # -*- coding: UTF-8 -*-
3.618355
4
opentsdb.py
bikash/opentsdb_spark
2
6630925
""" Concept from: [1] https://github.com/venidera/otsdb_client/blob/master/otsdb_client/client.py 2017.02, <NAME>, DNVGL Insert spark dataframe to opentsdb Example usage -------------- >>> import opentsdb >>> oc = opentsdb() >>> oc.ts_insert(df) Note: it works only with spark dataframe. """ import requests as gr im...
""" Concept from: [1] https://github.com/venidera/otsdb_client/blob/master/otsdb_client/client.py 2017.02, <NAME>, DNVGL Insert spark dataframe to opentsdb Example usage -------------- >>> import opentsdb >>> oc = opentsdb() >>> oc.ts_insert(df) Note: it works only with spark dataframe. """ import requests as gr im...
en
0.442524
Concept from: [1] https://github.com/venidera/otsdb_client/blob/master/otsdb_client/client.py 2017.02, <NAME>, DNVGL Insert spark dataframe to opentsdb Example usage -------------- >>> import opentsdb >>> oc = opentsdb() >>> oc.ts_insert(df) Note: it works only with spark dataframe. ## test opentsdb connection #gr.ma...
2.825808
3
1021/tspomp/kmeans2_kuro0613.py
Kurogi-Lab/CAN2
0
6630926
#!/bin/python # -*- coding: utf-8 -*- # #http://pythondatascience.plavox.info/scikit-learn/%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E5%88%86%E6%9E%90-k-means # #python kmeans2_kuro.py -fn ~/sotu/2017/can2b/tmp/tspSth.dat -K 2 -L 6 # import sys import numpy as np from sklearn.cluster import KMeans import argparse import pan...
#!/bin/python # -*- coding: utf-8 -*- # #http://pythondatascience.plavox.info/scikit-learn/%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E5%88%86%E6%9E%90-k-means # #python kmeans2_kuro.py -fn ~/sotu/2017/can2b/tmp/tspSth.dat -K 2 -L 6 # import sys import numpy as np from sklearn.cluster import KMeans import argparse import pan...
en
0.18333
#!/bin/python # -*- coding: utf-8 -*- # #http://pythondatascience.plavox.info/scikit-learn/%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E5%88%86%E6%9E%90-k-means # #python kmeans2_kuro.py -fn ~/sotu/2017/can2b/tmp/tspSth.dat -K 2 -L 6 # #sudo pip install pandas #import matplotlib.cm as cm #import os.path #import os #script_dir...
2.400818
2
generate_sim3C_filter_list.py
sc-zhang/ALLHiC_Eval_Data_Generators
0
6630927
<gh_stars>0 #!/usr/bin/env python import os import sys import gc from math import * import time import random # Get position of read based on chr with sam or bam file def get_read_pos_with_sam_bam_file(sam_bam_file, chr_len_db, bin_size, out_list): long_bin_size = bin_size.upper() long_bin_size = long_bin_size.repl...
#!/usr/bin/env python import os import sys import gc from math import * import time import random # Get position of read based on chr with sam or bam file def get_read_pos_with_sam_bam_file(sam_bam_file, chr_len_db, bin_size, out_list): long_bin_size = bin_size.upper() long_bin_size = long_bin_size.replace('K', '00...
en
0.74856
#!/usr/bin/env python # Get position of read based on chr with sam or bam file # Get chromosome length # Calc read counts on each bin # Draw heatmap of allhic result with matplotlib # mpl.cm.YlOrRd
2.315361
2
netket/custom/fermion_operator.py
yannra/netket
0
6630928
<gh_stars>0 import numpy as np from numba import jit from numba.typed import List from netket.operator._abstract_operator import AbstractOperator import numbers class SparseHermitianFermionOperator(AbstractOperator): def __init__(self, hilbert, prefactors, sites, spins): self._hilbert = hilbert s...
import numpy as np from numba import jit from numba.typed import List from netket.operator._abstract_operator import AbstractOperator import numbers class SparseHermitianFermionOperator(AbstractOperator): def __init__(self, hilbert, prefactors, sites, spins): self._hilbert = hilbert self._prefact...
gu
0.065878
# TODO: remove duplicates?
2.100439
2
core/migrations/0002_auto_20191223_1155.py
majestylink/majestyAccencis
0
6630929
# Generated by Django 2.2.7 on 2019-12-23 10:55 import ckeditor.fields import core.helpers from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import tinymce.models class Migration(migrations.Migration): dependencies = [ ...
# Generated by Django 2.2.7 on 2019-12-23 10:55 import ckeditor.fields import core.helpers from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import tinymce.models class Migration(migrations.Migration): dependencies = [ ...
en
0.821583
# Generated by Django 2.2.7 on 2019-12-23 10:55
1.86156
2
spider/commands/shell.py
fakegit/boris-spider
68
6630930
# -*- coding: utf-8 -*- """ Created on 2020/5/9 12:37 AM --------- @summary: --------- @author: Boris @email: <EMAIL> """ import json import re import sys import IPython from spider import Request def request(**kwargs): kwargs.setdefault("proxies", None) response = Request(**kwargs).get_response() prin...
# -*- coding: utf-8 -*- """ Created on 2020/5/9 12:37 AM --------- @summary: --------- @author: Boris @email: <EMAIL> """ import json import re import sys import IPython from spider import Request def request(**kwargs): kwargs.setdefault("proxies", None) response = Request(**kwargs).get_response() prin...
zh
0.193992
# -*- coding: utf-8 -*- Created on 2020/5/9 12:37 AM --------- @summary: --------- @author: Boris @email: <EMAIL> 解析及抓取curl请求 :param curl_args: [url, '-H', 'xxx', '-H', 'xxx', '--data-binary', '{"xxx":"xxx"}', '--compressed'] :return: 下载调试器 usage: spider shell [options] [args] optional arguments: -u, --...
2.920787
3
Course I/Алгоритмы Python/Part1/семинары/pract5/task1.py
GeorgiyDemo/FA
27
6630931
""" Реализовать решение квадратного уравнения через дискриминант """ import math class DescrSolver: def __init__(self, input_str): self.input_str = input_str self.parse_exp() self.get_descriminant() def is_digital(self, number): try: float(number) retur...
""" Реализовать решение квадратного уравнения через дискриминант """ import math class DescrSolver: def __init__(self, input_str): self.input_str = input_str self.parse_exp() self.get_descriminant() def is_digital(self, number): try: float(number) retur...
ru
0.958644
Реализовать решение квадратного уравнения через дискриминант # Определяем коэффициент a # Определяем коэффициент b # Определяем коэффициент c
3.747272
4
app/app.py
dcwangmit01/stock-check
0
6630932
<filename>app/app.py<gh_stars>0 import logging import os import re from app import utils log = logging.getLogger(__name__) class App(object): _singleton = dict() _jinja_dict = None def __init__(self): # Return a singleton self.__dict__ = App._singleton def get_config_dict(self, ct...
<filename>app/app.py<gh_stars>0 import logging import os import re from app import utils log = logging.getLogger(__name__) class App(object): _singleton = dict() _jinja_dict = None def __init__(self): # Return a singleton self.__dict__ = App._singleton def get_config_dict(self, ct...
en
0.789333
# Return a singleton # Manually cache, since memoization doesn't work with dict values # Make all environment variables starting with 'STOCKCHECK_' # accessible from the dict. # Add the config files as part of the dict # Render values containing nested jinja variables # Set the cache
2.389971
2
eoncloud_web/biz/urls.py
eoncloud-dev/eoncloud_web
10
6630933
<filename>eoncloud_web/biz/urls.py from django.conf.urls import patterns, include, url from rest_framework.urlpatterns import format_suffix_patterns from biz.instance import views as instance_view from biz.image import views as image_view from biz.network import views as network_view from biz.lbaas import views as l...
<filename>eoncloud_web/biz/urls.py from django.conf.urls import patterns, include, url from rest_framework.urlpatterns import format_suffix_patterns from biz.instance import views as instance_view from biz.image import views as image_view from biz.network import views as network_view from biz.lbaas import views as l...
en
0.508781
# various options and configurations # instance&flavor # image # network # router # LB # volume # floating #url(r'^floatings/search/$', floating_view.volume_list_view_by_instance), #url(r'^floatings/update/$', floating_view.volume_update_view), # FIREWALL # account # image # forum # idc # backup # workflow
1.757774
2
scripts/perf/timing.py
mhbliao/rocFFT
0
6630934
#!/usr/bin/env python3 # a timing script for FFTs and convolutions using OpenMP import sys, getopt import numpy as np from math import * import subprocess import os import re # regexp package import shutil import tempfile usage = '''A timing script for rocfft Usage: \ttiming.py \t\t-w <string> set working directory...
#!/usr/bin/env python3 # a timing script for FFTs and convolutions using OpenMP import sys, getopt import numpy as np from math import * import subprocess import os import re # regexp package import shutil import tempfile usage = '''A timing script for rocfft Usage: \ttiming.py \t\t-w <string> set working directory...
en
0.600546
#!/usr/bin/env python3 # a timing script for FFTs and convolutions using OpenMP # regexp package A timing script for rocfft Usage: \ttiming.py \t\t-w <string> set working directory for rocfft-rider \t\t-i <string> directory for dloaded libs (appendable) \t\t-o <string> name of output file (appendable for dload) \t\t-D...
2.318631
2
abcpy/graphtools.py
vishalbelsare/abcpy
89
6630935
<gh_stars>10-100 import numpy as np from abcpy.probabilisticmodels import Hyperparameter, ModelResultingFromOperation class GraphTools: """This class implements all methods that will be called recursively on the graph structure.""" def sample_from_prior(self, model=None, rng=np.random.RandomState()): ...
import numpy as np from abcpy.probabilisticmodels import Hyperparameter, ModelResultingFromOperation class GraphTools: """This class implements all methods that will be called recursively on the graph structure.""" def sample_from_prior(self, model=None, rng=np.random.RandomState()): """ Sam...
en
0.788383
This class implements all methods that will be called recursively on the graph structure. Samples values for all random variables of the model. Commonly used to sample new parameter values on the whole graph. Parameters ---------- model: abcpy.ProbabilisticModel object The r...
2.790988
3
PyWidget3/widget.py
galaxyjim/PyWidget3
0
6630936
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Copyright (c) 2009 <NAME> # Copyright (c) 2015 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided tha...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Copyright (c) 2009 <NAME> # Copyright (c) 2015 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided tha...
en
0.498708
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Copyright (c) 2009 <NAME> # Copyright (c) 2015 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that...
1.201805
1
venv/lib/python2.7/site-packages/ansible/modules/windows/win_stat.py
haind27/test01
37
6630937
<gh_stars>10-100 #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_v...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
en
0.701708
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name --- module: win_stat version_added: "1.7" short_des...
2.072232
2
tests/algorithm/common/test_model.py
zbzhu99/malib
0
6630938
import pytest from malib.algorithm.common.model import Model, get_model, mlp, RNN, MLP from gym import spaces import numpy as np @pytest.fixture def layers_config(): return [ {"units": 32, "activation": "ReLU"}, {"units": 32, "activation": "Tanh"}, {"units": 32, "activation": "LeakyReLU"},...
import pytest from malib.algorithm.common.model import Model, get_model, mlp, RNN, MLP from gym import spaces import numpy as np @pytest.fixture def layers_config(): return [ {"units": 32, "activation": "ReLU"}, {"units": 32, "activation": "Tanh"}, {"units": 32, "activation": "LeakyReLU"},...
none
1
2.116259
2
phigros/view/__init__.py
BETTEY-developers/pygros
1
6630939
import copy from os import path, stat import cocos import cocos.actions import cocos.sprite import cocos.layer import pyglet from . import data, settings from ..chart import Line, BaseNote, Drag, Flick, Hold, chart __all__ = ['preview'] combo_label = None score_label = None def update_labels(): global combo_l...
import copy from os import path, stat import cocos import cocos.actions import cocos.sprite import cocos.layer import pyglet from . import data, settings from ..chart import Line, BaseNote, Drag, Flick, Hold, chart __all__ = ['preview'] combo_label = None score_label = None def update_labels(): global combo_l...
none
1
2.141232
2
milvus/client/types.py
ireneontheway5/pymilvus
0
6630940
<reponame>ireneontheway5/pymilvus from enum import IntEnum class Status: """ :attribute code: int (optional) default as ok :attribute message: str (optional) current status message """ SUCCESS = 0 def __init__(self, code=SUCCESS, message="Success"): self.code = code self.mes...
from enum import IntEnum class Status: """ :attribute code: int (optional) default as ok :attribute message: str (optional) current status message """ SUCCESS = 0 def __init__(self, code=SUCCESS, message="Success"): self.code = code self.message = message def __repr__(s...
en
0.695689
:attribute code: int (optional) default as ok :attribute message: str (optional) current status message Make Status comparable with self by code # INT8 = 2 # INT16 = 3 # STRING = 20 # VECTOR = 200
3.305893
3
parser/fase2/team05/proyecto/analizadorFase2/Abstractas/Expresion.py
LopDlMa/tytus
0
6630941
from enum import Enum class Tipos(Enum): Numero = 1 Cadena = 2 Booleano = 3 Decimal = 4 Id = 5 ISQL = 6 class Expresion(): def __init__(self): self.trueLabel = self.falseLabel = ''
from enum import Enum class Tipos(Enum): Numero = 1 Cadena = 2 Booleano = 3 Decimal = 4 Id = 5 ISQL = 6 class Expresion(): def __init__(self): self.trueLabel = self.falseLabel = ''
none
1
3.404045
3
agreements/app/database/metadata.py
metagov/agreements-prototype
5
6630942
import json import logging from tinydb.database import Document from tinydb import where # container for metadata in the tinydb database class Metadata: def __init__(self, db): self.db = db self.table = db.table('metadata') self.logger = logging.getLogger(__name__) # initializes m...
import json import logging from tinydb.database import Document from tinydb import where # container for metadata in the tinydb database class Metadata: def __init__(self, db): self.db = db self.table = db.table('metadata') self.logger = logging.getLogger(__name__) # initializes m...
en
0.64779
# container for metadata in the tinydb database # initializes metadata table in database if it hasn't been created yet # retrieves a value from the metadata dictionary # converts to integer or float as needed # updates a value in the metadata dictionary
2.686791
3
devel/toolkitEditor/mainMenu/menuCallbacks.py
t3kt/raytk
108
6630943
# noinspection PyUnreachableCode if False: # noinspection PyUnresolvedReferences from _stubs import * from .mainMenu import MainMenu ext.mainMenu = MainMenu(COMP()) """ TopMenu callbacks Callbacks always take a single argument, which is a dictionary of values relevant to the callback. Print this dictionary to se...
# noinspection PyUnreachableCode if False: # noinspection PyUnresolvedReferences from _stubs import * from .mainMenu import MainMenu ext.mainMenu = MainMenu(COMP()) """ TopMenu callbacks Callbacks always take a single argument, which is a dictionary of values relevant to the callback. Print this dictionary to se...
en
0.624582
# noinspection PyUnreachableCode # noinspection PyUnresolvedReferences TopMenu callbacks Callbacks always take a single argument, which is a dictionary of values relevant to the callback. Print this dictionary to see what is being passed. The keys explain what each item is. TopMenu info keys: 'widget': the TopMenu w...
2.797218
3
test/test_binance.py
Artek199/przyjazn-pami-semkow-
13
6630944
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # <NAME> # <EMAIL> # MIT license import os import ema2 from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceWithdrawException, BinanceRequestException try: interv = '1w' symb='BTCUSDT' client = Client(os.getenv('BINANCE_APIKEY...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # <NAME> # <EMAIL> # MIT license import os import ema2 from binance.client import Client from binance.exceptions import BinanceAPIException, BinanceWithdrawException, BinanceRequestException try: interv = '1w' symb='BTCUSDT' client = Client(os.getenv('BINANCE_APIKEY...
en
0.195717
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # <NAME> # <EMAIL> # MIT license
2.377811
2
Estudos/Python_Exercicios_Curso_Em_Video/ex043.py
wiltonjr4/Python_Language
0
6630945
<reponame>wiltonjr4/Python_Language<filename>Estudos/Python_Exercicios_Curso_Em_Video/ex043.py peso = float(input('Qual é o seu peso? (Kg) ')) altura = float(input('Qual é a sua altura? (m)' )) imc = peso / (altura ** 2) print('O seu IMC atual é de: {:.1f}'.format(imc)) if imc < 18.5: print('Você está ABAIXO do pes...
peso = float(input('Qual é o seu peso? (Kg) ')) altura = float(input('Qual é a sua altura? (m)' )) imc = peso / (altura ** 2) print('O seu IMC atual é de: {:.1f}'.format(imc)) if imc < 18.5: print('Você está ABAIXO do peso normal!') elif imc <= 25: print('Você está com o peso IDEAL!') elif imc <= 30: print(...
none
1
3.803404
4
scripts/build_distributed_model.py
sunlightlabs/fcc-net-neutrality-comments
18
6630946
<filename>scripts/build_distributed_model.py # IPython log file import sys import os import logging from gensim import models, corpora sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.path.pardir)) import settings logging.basicConfig(format='%(asctime)s : %(lev...
<filename>scripts/build_distributed_model.py # IPython log file import sys import os import logging from gensim import models, corpora sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.path.pardir)) import settings logging.basicConfig(format='%(asctime)s : %(lev...
en
0.787727
# IPython log file
2.404596
2
Source/fastICA_jit.py
Liwen-ZHANG/fastica_lz
1
6630947
import scipy.linalg import numpy as np from numba import jit @jit def sym_decorrelation_jit(W): """ Symmetric decorrelation """ K = np.dot(W, W.T) s, u = np.linalg.eigh(K) W = (u @ np.diag(1.0/np.sqrt(s)) @ u.T) @ W return W def g_logcosh_jit(wx,alpha): """derivatives of logcosh""" retur...
import scipy.linalg import numpy as np from numba import jit @jit def sym_decorrelation_jit(W): """ Symmetric decorrelation """ K = np.dot(W, W.T) s, u = np.linalg.eigh(K) W = (u @ np.diag(1.0/np.sqrt(s)) @ u.T) @ W return W def g_logcosh_jit(wx,alpha): """derivatives of logcosh""" retur...
en
0.757875
Symmetric decorrelation derivatives of logcosh second derivatives of logcosh # exp derivatives of exp second derivatives of exp FastICA algorithm for several units #check if n_comp is valid #centering #by subtracting the mean of each column of X (array). #whitening # initial random weght vector # The FastICA algorithm
2.396611
2
h2o-py/tests/testdir_jira/pyunit_pubdev_5397_r2_early_stop_NOFEATURE.py
ahmedengu/h2o-3
6,098
6630948
<reponame>ahmedengu/h2o-3<filename>h2o-py/tests/testdir_jira/pyunit_pubdev_5397_r2_early_stop_NOFEATURE.py from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator model_runtime = [] # store actua...
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator model_runtime = [] # store actual model runtime in seconds model_maxRuntime = [] # store given maximum runtime restrictions placed on bui...
en
0.883868
# store actual model runtime in seconds # store given maximum runtime restrictions placed on building models for different algos # in seconds # % by which the model runtime exceeds the maximum runtime. # fractor by which we allow the model runtime over-run to be This pyunit test is written to ensure that the max_runtim...
2.267311
2
tests/test_cli.py
HenriqueLin/CityWok-ManagementSystem
0
6630949
<filename>tests/test_cli.py import os import pytest from citywok_ms import db from citywok_ms.cli import compile, create, drop, init, load_example, update from flask.cli import shell_command from flask.testing import FlaskCliRunner import shutil def test_dev_load_without_create(app_without_db): runner = FlaskCli...
<filename>tests/test_cli.py import os import pytest from citywok_ms import db from citywok_ms.cli import compile, create, drop, init, load_example, update from flask.cli import shell_command from flask.testing import FlaskCliRunner import shutil def test_dev_load_without_create(app_without_db): runner = FlaskCli...
es
0.118445
# i18n init # i18n update # i18n compile # clean up
2.295224
2
netcat.py
wwwins/TreeAdmin
0
6630950
import socket def netcat(hostname, port, content): buf = '' s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.settimeout(5) s.connect((hostname, port)) s.sendall(content) s.shutdown(socket.SHUT_WR) while 1: data = s.recv(1024) if data == "": break bu...
import socket def netcat(hostname, port, content): buf = '' s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.settimeout(5) s.connect((hostname, port)) s.sendall(content) s.shutdown(socket.SHUT_WR) while 1: data = s.recv(1024) if data == "": break bu...
none
1
2.917754
3