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 |
|---|---|---|---|---|---|---|---|---|---|---|
python/GafferUI/ScriptEditor.py | PaulDoessel/gaffer-play | 0 | 9800 | ##########################################################################
#
# Copyright (c) 2011-2012, <NAME>. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | ##########################################################################
#
# Copyright (c) 2011-2012, <NAME>. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | en | 0.691688 | ########################################################################## # # Copyright (c) 2011-2012, <NAME>. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ... | 0.835943 | 1 |
03/triangle.py | machinelearningdeveloper/aoc_2016 | 0 | 9801 | <reponame>machinelearningdeveloper/aoc_2016<filename>03/triangle.py
"""Test whether putative triangles, specified as triples of side lengths,
in fact are possible."""
def load_triangles(filename):
"""Load triangles from filename."""
triangles = []
with open(filename) as f:
for line in f:
... | """Test whether putative triangles, specified as triples of side lengths,
in fact are possible."""
def load_triangles(filename):
"""Load triangles from filename."""
triangles = []
with open(filename) as f:
for line in f:
if line.strip():
triangles.append(tuple([int(side) ... | en | 0.873429 | Test whether putative triangles, specified as triples of side lengths, in fact are possible. Load triangles from filename. Instead of loading one triangle per line, load one-third each of three triangles per line. The sum of the lengths of every pair of sides in a, b, c must be larger than the length of the rem... | 4.221121 | 4 |
ExerciciosdePython/ex049.py | aleksandromelo/Exercicios | 0 | 9802 | num = int(input('Digite um número para ver sua tabuada: '))
for i in range(1, 11):
print('{} x {:2} = {}'.format(num, i, num * i)) | num = int(input('Digite um número para ver sua tabuada: '))
for i in range(1, 11):
print('{} x {:2} = {}'.format(num, i, num * i)) | none | 1 | 3.998134 | 4 | |
ebmeta/actions/version.py | bkidwell/ebmeta-old | 1 | 9803 | <gh_stars>1-10
"""Print ebmeta version number."""
import sys
import ebmeta
def run():
print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION)
sys.exit(0)
| """Print ebmeta version number."""
import sys
import ebmeta
def run():
print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION)
sys.exit(0) | en | 0.485589 | Print ebmeta version number. | 1.742575 | 2 |
backend/api/tests/mixins/credit_trade_relationship.py | amichard/tfrs | 18 | 9804 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# pylint: disable=no-member,invalid-name,duplicate-code
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accorda... | # -*- coding: utf-8 -*-
# pylint: disable=no-member,invalid-name,duplicate-code
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the ... | en | 0.879166 | # -*- coding: utf-8 -*- # pylint: disable=no-member,invalid-name,duplicate-code REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewabl... | 2.202087 | 2 |
superset/superset_config.py | panchohumeres/dynamo-covid | 4 | 9805 | import os
SERVER_NAME = os.getenv('DOMAIN_SUPERSET')
PUBLIC_ROLE_LIKE_GAMMA = True
SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict']
SESSION_COOKIE_HTTPONLY = False
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
POSTGRES_DB=os.getenv('POSTGRES_DB')
POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD')
POSTG... | import os
SERVER_NAME = os.getenv('DOMAIN_SUPERSET')
PUBLIC_ROLE_LIKE_GAMMA = True
SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict']
SESSION_COOKIE_HTTPONLY = False
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
POSTGRES_DB=os.getenv('POSTGRES_DB')
POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD')
POSTG... | en | 0.895065 | # One of [None, 'Lax', 'Strict'] | 1.877889 | 2 |
mybot.py | johnnyboiii3020/matchmaking-bot | 0 | 9806 | <reponame>johnnyboiii3020/matchmaking-bot
import discord
import json
import random
import os
from discord.ext import commands
TOKEN = ""
client = commands.Bot(command_prefix = '--')
os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles')
SoloCounter = 30
SolominCounter = 10
Queueiter = 1
T_Queueiter =... | import discord
import json
import random
import os
from discord.ext import commands
TOKEN = ""
client = commands.Bot(command_prefix = '--')
os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles')
SoloCounter = 30
SolominCounter = 10
Queueiter = 1
T_Queueiter = 1
TeamCounter = 50
TeamminCounter = 20
... | de | 0.796602 | ######################### Register Team ################################# ############################ Register Solo ################################### ############################### Win Team ################################ ###############CReate Team Queue Channel########################### #########################... | 2.628248 | 3 |
conversation.py | markemus/economy | 2 | 9807 | import database as d
import numpy as np
import random
from transitions import Machine
#Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i.
#Each entry i,j = the probability of moving to state i from state j.
#target state D = end of convers... | import database as d
import numpy as np
import random
from transitions import Machine
#Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i.
#Each entry i,j = the probability of moving to state i from state j.
#target state D = end of convers... | en | 0.742457 | #Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i. #Each entry i,j = the probability of moving to state i from state j. #target state D = end of conversation. We start in state D when initializing conversation. #row vectors sum to 1, inter... | 3.189616 | 3 |
src/createData.py | saijananiganesan/SimPathFinder | 0 | 9808 | from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData
E = ExtractLabeledData(data_dir='../labeldata/')
E.get_pathways()
E.get_pathway_names()
E.get_classes_dict()
E.create_df_all_labels()
| from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData
E = ExtractLabeledData(data_dir='../labeldata/')
E.get_pathways()
E.get_pathway_names()
E.get_classes_dict()
E.create_df_all_labels()
| none | 1 | 1.652122 | 2 | |
blog/views.py | farman99ahmed/diyblog | 0 | 9809 | from django.shortcuts import render, redirect
from .forms import AuthorForm, BlogForm, NewUserForm
from .models import Author, Blog
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.decorator... | from django.shortcuts import render, redirect
from .forms import AuthorForm, BlogForm, NewUserForm
from .models import Author, Blog
from django.contrib.auth import login, authenticate, logout
from django.contrib import messages
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.decorator... | en | 0.968116 | # Create your views here. | 2.268393 | 2 |
tests/conftest.py | SolomidHero/speech-regeneration-enhancer | 8 | 9810 | <filename>tests/conftest.py
# here we make fixtures of toy data
# real parameters are stored and accessed from config
import pytest
import librosa
import os
import numpy as np
from hydra.experimental import compose, initialize
@pytest.fixture(scope="session")
def cfg():
with initialize(config_path="../", job_nam... | <filename>tests/conftest.py
# here we make fixtures of toy data
# real parameters are stored and accessed from config
import pytest
import librosa
import os
import numpy as np
from hydra.experimental import compose, initialize
@pytest.fixture(scope="session")
def cfg():
with initialize(config_path="../", job_nam... | en | 0.841165 | # here we make fixtures of toy data # real parameters are stored and accessed from config # It is not clear if we should cleanup the test directories # or leave them for debugging # https://github.com/pytest-dev/pytest/issues/3051 | 1.974091 | 2 |
dataclassses_howto.py | CvanderStoep/VideosSampleCode | 285 | 9811 | <gh_stars>100-1000
import dataclasses
import inspect
from dataclasses import dataclass, field
from pprint import pprint
import attr
class ManualComment:
def __init__(self, id: int, text: str):
self.id: int = id
self.text: str = text
def __repr__(self):
return "{}(id={}, text={})".for... | import dataclasses
import inspect
from dataclasses import dataclass, field
from pprint import pprint
import attr
class ManualComment:
def __init__(self, id: int, text: str):
self.id: int = id
self.text: str = text
def __repr__(self):
return "{}(id={}, text={})".format(self.__class__.... | en | 0.947151 | # comment.id = 3 # can't immutable | 3.221804 | 3 |
downloadMusic/main.py | yaosir0317/my_first | 0 | 9812 | <reponame>yaosir0317/my_first
from enum import Enum
import requests
class MusicAPP(Enum):
qq = "qq"
wy = "netease"
PRE_URL = "http://www.musictool.top/"
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"}
def... | from enum import Enum
import requests
class MusicAPP(Enum):
qq = "qq"
wy = "netease"
PRE_URL = "http://www.musictool.top/"
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"}
def get_music_list(name, app, pag... | none | 1 | 3.057793 | 3 | |
app/api/serializers.py | michelmarcondes/django-study-with-docker | 0 | 9813 | <filename>app/api/serializers.py
from rest_framework import serializers
from projects.models import Project, Tag, Review
from users.models import Profile
class ReviewSerializer(serializers.ModelSerializer):
class Meta:
model = Review
fields = '__all__'
class ProfileSerializer(serializers.ModelSe... | <filename>app/api/serializers.py
from rest_framework import serializers
from projects.models import Project, Tag, Review
from users.models import Profile
class ReviewSerializer(serializers.ModelSerializer):
class Meta:
model = Review
fields = '__all__'
class ProfileSerializer(serializers.ModelSe... | none | 1 | 2.323122 | 2 | |
corehq/apps/domain/views.py | johan--/commcare-hq | 0 | 9814 | import copy
import datetime
from decimal import Decimal
import logging
import uuid
import json
import cStringIO
from couchdbkit import ResourceNotFound
import dateutil
from django.core.paginator import Paginator
from django.views.generic import View
from django.db.models import Sum
from django.conf import settings
fro... | import copy
import datetime
from decimal import Decimal
import logging
import uuid
import json
import cStringIO
from couchdbkit import ResourceNotFound
import dateutil
from django.core.paginator import Paginator
from django.views.generic import View
from django.db.models import Sum
from django.conf import settings
fro... | en | 0.911647 | # Domain not required here - we could be selecting it for the first time. See notes domain.decorators # about why we need this custom login_required decorator # mirrors logic in login_and_domain_required Paving the way for a world of entirely class-based views. Let's do this, guys. :-) Set strict_domai... | 1.249772 | 1 |
src/anmi/T2/funcs_met_iters.py | alexmascension/ANMI | 1 | 9815 | <filename>src/anmi/T2/funcs_met_iters.py
from sympy import simplify, zeros
from sympy import Matrix as mat
import numpy as np
from ..genericas import print_verbose, matriz_inversa
def criterio_radio_espectral(H, verbose=True):
eigs = [simplify(i) for i in list(H.eigenvals().keys())]
print_verbose("||Criteri... | <filename>src/anmi/T2/funcs_met_iters.py
from sympy import simplify, zeros
from sympy import Matrix as mat
import numpy as np
from ..genericas import print_verbose, matriz_inversa
def criterio_radio_espectral(H, verbose=True):
eigs = [simplify(i) for i in list(H.eigenvals().keys())]
print_verbose("||Criteri... | es | 0.733967 | Aplica el método iterativo designado Args: A (matriz): Matriz de valores b (vector, optional): Vector de rhs. Por defecto es 1, 1, ..., 1. x0 (vector, optional): Vector con elementos de la primera iteración. Por defecto es 1, 1, ..., 1. metodo (str, optional): método de resolución, ... | 2.649837 | 3 |
{{cookiecutter.project_hyphen}}/{{cookiecutter.project_slug}}/__init__.py | zhangxianbing/cookiecutter-pypackage | 1 | 9816 | """{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}"""
__version__ = "{{ cookiecutter.project_version }}"
__author__ = """{{ cookiecutter.author_name }}"""
__email__ = "{{ cookiecutter.author_email }}"
prog_name = "{{ cookiecutter.project_hyphen }}"
| """{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}"""
__version__ = "{{ cookiecutter.project_version }}"
__author__ = """{{ cookiecutter.author_name }}"""
__email__ = "{{ cookiecutter.author_email }}"
prog_name = "{{ cookiecutter.project_hyphen }}"
| en | 0.634386 | {{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }} {{ cookiecutter.author_name }} | 1.188211 | 1 |
services/osparc-gateway-server/tests/integration/_dask_helpers.py | mguidon/osparc-dask-gateway | 1 | 9817 | from typing import NamedTuple
from dask_gateway_server.app import DaskGateway
class DaskGatewayServer(NamedTuple):
address: str
proxy_address: str
password: str
server: DaskGateway
| from typing import NamedTuple
from dask_gateway_server.app import DaskGateway
class DaskGatewayServer(NamedTuple):
address: str
proxy_address: str
password: str
server: DaskGateway
| none | 1 | 1.664768 | 2 | |
rdkit/ML/InfoTheory/BitRank.py | kazuyaujihara/rdkit | 1,609 | 9818 | <filename>rdkit/ML/InfoTheory/BitRank.py
#
# Copyright (C) 2001,2002,2003 <NAME> and Rational Discovery LLC
#
""" Functionality for ranking bits using info gains
**Definitions used in this module**
- *sequence*: an object capable of containing other objects which supports
__getitem__() and __len__(). Ex... | <filename>rdkit/ML/InfoTheory/BitRank.py
#
# Copyright (C) 2001,2002,2003 <NAME> and Rational Discovery LLC
#
""" Functionality for ranking bits using info gains
**Definitions used in this module**
- *sequence*: an object capable of containing other objects which supports
__getitem__() and __len__(). Ex... | en | 0.678291 | # # Copyright (C) 2001,2002,2003 <NAME> and Rational Discovery LLC # Functionality for ranking bits using info gains **Definitions used in this module** - *sequence*: an object capable of containing other objects which supports __getitem__() and __len__(). Examples of these include lists, tuples, and ... | 2.694171 | 3 |
trainer/dataset.py | vinay-swamy/gMVP | 2 | 9819 | import tensorflow as tf
import os
import pickle
import numpy as np
from constant_params import input_feature_dim, window_size
def build_dataset(input_tfrecord_files, batch_size):
drop_remainder = False
feature_description = {
'label': tf.io.FixedLenFeature([], tf.int64),
'ref_aa': tf.io.Fixe... | import tensorflow as tf
import os
import pickle
import numpy as np
from constant_params import input_feature_dim, window_size
def build_dataset(input_tfrecord_files, batch_size):
drop_remainder = False
feature_description = {
'label': tf.io.FixedLenFeature([], tf.int64),
'ref_aa': tf.io.Fixe... | en | 0.167975 | #mask the postion of interest pos_encoding = 1.0 + tf.cast( tf.math.abs(window_size // 2 - tf.range(window_size)), dtype=tf.float32) #pos_encoding = tf.math.log() / tf.math.log(2.0) feature = tf.concat([feature, pos_encoding[:, tf.newaxis]], axis=-1) #dataset = dataset.prefetch(4... | 2.293552 | 2 |
layers/eight_mile/pytorch/layers.py | dpressel/baseline | 241 | 9820 | <gh_stars>100-1000
import copy
import math
import logging
from typing import Dict, List, Optional, Tuple, Union
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.jit as jit
import torch.autograd
import contextlib
import glob
from eight_mile.utils import listify... | import copy
import math
import logging
from typing import Dict, List, Optional, Tuple, Union
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.jit as jit
import torch.autograd
import contextlib
import glob
from eight_mile.utils import listify, Offsets, is_seque... | en | 0.792782 | Generate a sequence mask of shape `BxT` based on the given lengths :param lengths: A `B` tensor containing the lengths of each example :param max_len: The maximum width (length) allowed in this mask (default to None) :return: A mask # 1 x T # B x 1 # Broadcast to B x T, compares increasing number to max Ge... | 2.453006 | 2 |
setup.py | flother/pdf-search | 5 | 9821 | <filename>setup.py<gh_stars>1-10
from setuptools import setup
setup(
name='espdf',
version='0.1.0-dev',
url='https://github.com/flother/pdf-search',
py_modules=(
'espdf',
),
install_requires=(
'certifi',
'elasticsearch-dsl',
),
entry_points={
'console_sc... | <filename>setup.py<gh_stars>1-10
from setuptools import setup
setup(
name='espdf',
version='0.1.0-dev',
url='https://github.com/flother/pdf-search',
py_modules=(
'espdf',
),
install_requires=(
'certifi',
'elasticsearch-dsl',
),
entry_points={
'console_sc... | none | 1 | 1.383159 | 1 | |
pywallet/network.py | martexcoin/pywallet | 1 | 9822 | <filename>pywallet/network.py
class BitcoinGoldMainNet(object):
"""Bitcoin Gold MainNet version bytes. """
NAME = "Bitcoin Gold Main Net"
COIN = "BTG"
SCRIPT_ADDRESS = 0x17 # int(0x17) = 23
PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses
SECRET_KEY = 0x80 # int(... | <filename>pywallet/network.py
class BitcoinGoldMainNet(object):
"""Bitcoin Gold MainNet version bytes. """
NAME = "Bitcoin Gold Main Net"
COIN = "BTG"
SCRIPT_ADDRESS = 0x17 # int(0x17) = 23
PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses
SECRET_KEY = 0x80 # int(... | en | 0.687791 | Bitcoin Gold MainNet version bytes. # int(0x17) = 23 # int(0x26) = 38 # Used to create payment addresses # int(0x80) = 128 # Used for WIF format # Used to serialize public BIP32 addresses # Used to serialize private BIP32 addresses Bitcoin Cash MainNet version bytes. # int(0x28) = 40 # int(0x00) = 28 # Used to creat... | 2.86083 | 3 |
conanfile.py | sintef-ocean/conan-clapack | 0 | 9823 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import shutil
class ClapackConan(ConanFile):
name = "clapack"
version = "3.2.1"
license = "BSD 3-Clause"
# BSD-3-Clause-Clear
url = "https://github.com/sintef-ocean/conan-clapack"
author = "<NAME>"
ho... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import shutil
class ClapackConan(ConanFile):
name = "clapack"
version = "3.2.1"
license = "BSD 3-Clause"
# BSD-3-Clause-Clear
url = "https://github.com/sintef-ocean/conan-clapack"
author = "<NAME>"
ho... | en | 0.37357 | #!/usr/bin/env python # -*- coding: utf-8 -*- # BSD-3-Clause-Clear | 1.792409 | 2 |
yacos/algorithm/metaheuristics.py | ComputerSystemsLaboratory/YaCoS | 8 | 9824 | """
Copyright 2021 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... | """
Copyright 2021 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... | en | 0.644459 | Copyright 2021 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed un... | 2.490748 | 2 |
lab_03/main.py | solnishko-pvs/Modeling_BMSTU | 0 | 9825 | import tkinter as tk
from scipy.stats import chi2, chisquare
COLOR = '#dddddd'
COLUMNS_COLOR = '#ffffff'
MAX_SIZE = 10
WIDGET_WIDTH = 25
class LinearCongruent:
m = 2**32
a = 1664525
c = 1013904223
_cur = 1
def next(self):
self._cur = (self.a * self._cur + self.c) % self.m
return s... | import tkinter as tk
from scipy.stats import chi2, chisquare
COLOR = '#dddddd'
COLUMNS_COLOR = '#ffffff'
MAX_SIZE = 10
WIDGET_WIDTH = 25
class LinearCongruent:
m = 2**32
a = 1664525
c = 1013904223
_cur = 1
def next(self):
self._cur = (self.a * self._cur + self.c) % self.m
return s... | en | 0.191331 | #print(chisquare(cnt)) #self.listbox_frame.pack() | 2.752201 | 3 |
VacationPy/api_keys.py | tylermneher/python-api-challenge | 0 | 9826 | # OpenWeatherMap API Key
weather_api_key = "MyOpenWeatherMapAPIKey"
# Google API Key
g_key = "MyGoogleKey" | # OpenWeatherMap API Key
weather_api_key = "MyOpenWeatherMapAPIKey"
# Google API Key
g_key = "MyGoogleKey" | en | 0.293972 | # OpenWeatherMap API Key # Google API Key | 1.271795 | 1 |
aries_cloudagent/protocols/actionmenu/v1_0/messages/menu_request.py | panickervinod/aries-cloudagent-python | 0 | 9827 | """Represents a request for an action menu."""
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE
HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler"
class MenuRequest(AgentMessage):
"""Class re... | """Represents a request for an action menu."""
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE
HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler"
class MenuRequest(AgentMessage):
"""Class re... | en | 0.502618 | Represents a request for an action menu. Class representing a request for an action menu. Metadata for action menu request. Initialize a menu request object. MenuRequest schema class. MenuRequest schema metadata. | 2.192493 | 2 |
porthole/management/commands/brocade.py | jsayles/Porthole | 0 | 9828 | <filename>porthole/management/commands/brocade.py
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from porthole import models, brocade
class Command(BaseCommand):
help = "Command the Brocade switch stacks"
args = ""
requires_system_checks = False
de... | <filename>porthole/management/commands/brocade.py
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from porthole import models, brocade
class Command(BaseCommand):
help = "Command the Brocade switch stacks"
args = ""
requires_system_checks = False
de... | none | 1 | 2.100889 | 2 | |
joulia/unit_conversions_test.py | willjschmitt/joulia-webserver | 0 | 9829 | """Tests joulia.unit_conversions.
"""
from django.test import TestCase
from joulia import unit_conversions
class GramsToPoundsTest(TestCase):
def test_grams_to_pounds(self):
self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462)
class GramsToOuncesTest(TestCase):
def test_grams_to_ou... | """Tests joulia.unit_conversions.
"""
from django.test import TestCase
from joulia import unit_conversions
class GramsToPoundsTest(TestCase):
def test_grams_to_pounds(self):
self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462)
class GramsToOuncesTest(TestCase):
def test_grams_to_ou... | en | 0.318507 | Tests joulia.unit_conversions. | 2.341977 | 2 |
Django/blog/tests.py | zarif007/Blog-site | 1 | 9830 | <filename>Django/blog/tests.py<gh_stars>1-10
from django.contrib.auth.models import User
from django.test import TestCase
from blog.models import Category, Post
class Test_Create_Post(TestCase):
@classmethod
def setUpTestData(cls):
test_category = Category.objects.create(name='django')
testu... | <filename>Django/blog/tests.py<gh_stars>1-10
from django.contrib.auth.models import User
from django.test import TestCase
from blog.models import Category, Post
class Test_Create_Post(TestCase):
@classmethod
def setUpTestData(cls):
test_category = Category.objects.create(name='django')
testu... | none | 1 | 2.406366 | 2 | |
scripts/train_presets/beads.py | kreshuklab/hylfm-net | 8 | 9831 | from pathlib import Path
from hylfm.hylfm_types import (
CriterionChoice,
DatasetChoice,
LRSchedThresMode,
LRSchedulerChoice,
MetricChoice,
OptimizerChoice,
PeriodUnit,
)
from hylfm.model import HyLFM_Net
from hylfm.train import train
if __name__ == "__main__":
train(
dataset=... | from pathlib import Path
from hylfm.hylfm_types import (
CriterionChoice,
DatasetChoice,
LRSchedThresMode,
LRSchedulerChoice,
MetricChoice,
OptimizerChoice,
PeriodUnit,
)
from hylfm.model import HyLFM_Net
from hylfm.train import train
if __name__ == "__main__":
train(
dataset=... | en | 0.604203 | # Path() # model | 1.849243 | 2 |
TrainingPreprocess/filtered_to_dataset.py | CsekM8/LVH-THESIS | 0 | 9832 | import os
import pickle
from PIL import Image
class PatientToImageFolder:
def __init__(self, sourceFolder):
self.sourceFolder = sourceFolder
# How many patient with contrast SA for each pathology (used for classification)
self.contrastSApathologyDict = {}
# How many patient with c... | import os
import pickle
from PIL import Image
class PatientToImageFolder:
def __init__(self, sourceFolder):
self.sourceFolder = sourceFolder
# How many patient with contrast SA for each pathology (used for classification)
self.contrastSApathologyDict = {}
# How many patient with c... | en | 0.343182 | # How many patient with contrast SA for each pathology (used for classification) # How many patient with contrast LA for each pathology (used for classification) # How many patient with SA image (used for autoencoder training) # How many patient with LA image (used for autoencoder training) # elif "sport" in patho: # ... | 2.685809 | 3 |
scripts/pipeline/a06a_submission.py | Iolaum/Phi1337 | 0 | 9833 | import pandas as pd
import numpy as np
import pickle
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from math import sqrt
from sklearn.svm import SVR
from sklearn.svm import LinearSVR
from sklearn.preprocessing imp... | import pandas as pd
import numpy as np
import pickle
from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from math import sqrt
from sklearn.svm import SVR
from sklearn.svm import LinearSVR
from sklearn.preprocessing imp... | en | 0.494724 | # load model # Fill NaN value # score_df = score_df.fillna(0.0) # The last column is the target # Debug # Debug #yts_error = sqrt(mean_squared_error(yts_pred, yts)) # create submission file # Change between: # svr # linear # rfr | 2.667833 | 3 |
Data Gathering/PythonPlottingScript.py | Carter-eng/SeniorDesign | 0 | 9834 | import numpy as np
import serial
import time
import matplotlib.pyplot as plt
def getData():
ser = serial.Serial('/dev/ttyACM7', 9600)
sensorReadings = []
start = time.time()
current = time.time()
while current - start < 10:
data =ser.readline()
sensorReadings.append(floa... | import numpy as np
import serial
import time
import matplotlib.pyplot as plt
def getData():
ser = serial.Serial('/dev/ttyACM7', 9600)
sensorReadings = []
start = time.time()
current = time.time()
while current - start < 10:
data =ser.readline()
sensorReadings.append(floa... | none | 1 | 2.78892 | 3 | |
Examples/Rich_Message_Example.py | robinvoogt/text-sdk-python | 2 | 9835 | from CMText.TextClient import TextClient
# Message to be send
message = 'Examples message to be send'
# Media to be send
media = {
"mediaName": "conversational-commerce",
"mediaUri": "https://www.cm.com/cdn/cm/cm.png",
"mimeType": "image/png"
}
# AllowedChannels in this ca... | from CMText.TextClient import TextClient
# Message to be send
message = 'Examples message to be send'
# Media to be send
media = {
"mediaName": "conversational-commerce",
"mediaUri": "https://www.cm.com/cdn/cm/cm.png",
"mimeType": "image/png"
}
# AllowedChannels in this ca... | en | 0.768204 | # Message to be send # Media to be send # AllowedChannels in this case Whatsapp # Recipients # Instantiate client with your own api-key # Add a Rich message to the queue # Send the messages # Print response | 2.582542 | 3 |
client/audio.py | Dmitry450/asynciogame | 0 | 9836 | <filename>client/audio.py
import pygame
from pygame.math import Vector2
class Sound:
def __init__(self, manager, snd, volume=1.0):
self.manager = manager
self.snd = pygame.mixer.Sound(snd)
self.snd.set_volume(1.0)
self.ttl = snd.get_length()
self.play... | <filename>client/audio.py
import pygame
from pygame.math import Vector2
class Sound:
def __init__(self, manager, snd, volume=1.0):
self.manager = manager
self.snd = pygame.mixer.Sound(snd)
self.snd.set_volume(1.0)
self.ttl = snd.get_length()
self.play... | en | 0.738524 | # Actually sound can be "attached_to_position" and "attached_to_entity". # To avoid adding EntityManager reference into AudioManager, "position" # will be replaced by entity.position in Connection when sound event handled. # Anyway, d["type"] will be set to "attached" | 3.056284 | 3 |
bot/ganjoor/category_choose.py | MmeK/ganjoor-telegram-bot | 0 | 9837 |
# Copyright 2021 <NAME> <<EMAIL>>.
# SPDX-License-Identifier: MIT
# Telegram API framework core imports
from collections import namedtuple
from functools import partial
from ganjoor.ganjoor import Ganjoor
from telegram.ext import Dispatcher, CallbackContext
from telegram import Update
# Helper methods import
from util... |
# Copyright 2021 <NAME> <<EMAIL>>.
# SPDX-License-Identifier: MIT
# Telegram API framework core imports
from collections import namedtuple
from functools import partial
from ganjoor.ganjoor import Ganjoor
from telegram.ext import Dispatcher, CallbackContext
from telegram import Update
# Helper methods import
from util... | en | 0.32484 | # Copyright 2021 <NAME> <<EMAIL>>. # SPDX-License-Identifier: MIT # Telegram API framework core imports # Helper methods import # Telegram API framework handlers imports # Init logger Provide handlers initialization. Process a /start command. # query.answer() # query.edit_reply_markup() | 2.130924 | 2 |
python/util/md_utils.py | walterfan/snippets | 1 | 9838 | <filename>python/util/md_utils.py<gh_stars>1-10
import os
import sys
import struct
import re
import logging
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def list_to_md(str_list):
output = ""
for str in str_list:
output = output + "* %s \n" % str
... | <filename>python/util/md_utils.py<gh_stars>1-10
import os
import sys
import struct
import re
import logging
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def list_to_md(str_list):
output = ""
for str in str_list:
output = output + "* %s \n" % str
... | none | 1 | 2.949492 | 3 | |
board/main.py | Josverl/micropython-stubber | 96 | 9839 | import uos as os
import time
def countdown():
for i in range(5, 0, -1):
print("start stubbing in {}...".format(i))
time.sleep(1)
import createstubs
# import stub_lvgl
try:
# only run import if no stubs yet
os.listdir("stubs")
print("stub folder was found, stubbing is not aut... | import uos as os
import time
def countdown():
for i in range(5, 0, -1):
print("start stubbing in {}...".format(i))
time.sleep(1)
import createstubs
# import stub_lvgl
try:
# only run import if no stubs yet
os.listdir("stubs")
print("stub folder was found, stubbing is not aut... | en | 0.476331 | # import stub_lvgl # only run import if no stubs yet | 2.329535 | 2 |
third_party/blink/tools/blinkpy/web_tests/breakpad/dump_reader_multipart_unittest.py | zipated/src | 2,151 | 9840 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | en | 0.789713 | # Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ... | 1.293449 | 1 |
scripts/emoji-to-scl.py | SilverWingedSeraph/sws-dotfiles | 3 | 9841 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE
emojis="""⛑🏻 Helmet With White Cross, Type-1-2
⛑🏼 Helmet With White Cross, Type-3
⛑🏽 Helmet With White Cross, Type-4
⛑🏾 Helmet With White Cross, Type-5
⛑🏿 Helmet With White Cross, Type-6
💏🏻 Kiss, Type-1-2
💏🏼 Kiss, Type-3
💏🏽 Kiss,... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE
emojis="""⛑🏻 Helmet With White Cross, Type-1-2
⛑🏼 Helmet With White Cross, Type-3
⛑🏽 Helmet With White Cross, Type-4
⛑🏾 Helmet With White Cross, Type-5
⛑🏿 Helmet With White Cross, Type-6
💏🏻 Kiss, Type-1-2
💏🏼 Kiss, Type-3
💏🏽 Kiss,... | en | 0.437167 | #!/usr/bin/python3 # -*- coding: utf-8 -*- ⛑🏻 Helmet With White Cross, Type-1-2 ⛑🏼 Helmet With White Cross, Type-3 ⛑🏽 Helmet With White Cross, Type-4 ⛑🏾 Helmet With White Cross, Type-5 ⛑🏿 Helmet With White Cross, Type-6 💏🏻 Kiss, Type-1-2 💏🏼 Kiss, Type-3 💏🏽 Kiss, Type-4 💏🏾 Kiss, Type-5 💏🏿 Kiss, Type-6 💑�... | 2.254053 | 2 |
src/ngc/main.py | HubTou/ngc | 0 | 9842 | #!/usr/bin/env python
""" ngc - n-grams count
License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause)
Author: <NAME>
"""
import getopt
import logging
import os
import re
import string
import sys
import unicode2ascii
# Version string used by the what(1) and ident(1) commands:
ID = "@(#) $Id: ngc - n-... | #!/usr/bin/env python
""" ngc - n-grams count
License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause)
Author: <NAME>
"""
import getopt
import logging
import os
import re
import string
import sys
import unicode2ascii
# Version string used by the what(1) and ident(1) commands:
ID = "@(#) $Id: ngc - n-... | de | 0.409701 | #!/usr/bin/env python ngc - n-grams count License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause) Author: <NAME> # Version string used by the what(1) and ident(1) commands: #) $Id: ngc - n-grams count v1.0.2 (September 26, 2021) by <NAME> $" # Default parameters. Can be superseded by command line optio... | 2.275514 | 2 |
openquake.hazardlib/openquake/hazardlib/tests/gsim/campbell_2003_test.py | rainzhop/ConvNetQuake | 0 | 9843 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | en | 0.788075 | # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2016 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen... | 1.822975 | 2 |
sktime/regression/interval_based/_tsf.py | khrapovs/sktime | 1 | 9844 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""Time Series Forest Regressor (TSF)."""
__author__ = ["<NAME>", "kkoziara", "luiszugasti", "kanand77", "<NAME>"]
__all__ = ["TimeSeriesForestRegressor"]
import numpy as np
from joblib import Parallel, delayed
from sklearn.ensemble._forest import ForestRegressor
from sklearn.tr... | # -*- coding: utf-8 -*-
"""Time Series Forest Regressor (TSF)."""
__author__ = ["<NAME>", "kkoziara", "luiszugasti", "kanand77", "<NAME>"]
__all__ = ["TimeSeriesForestRegressor"]
import numpy as np
from joblib import Parallel, delayed
from sklearn.ensemble._forest import ForestRegressor
from sklearn.tree import Decis... | en | 0.714633 | # -*- coding: utf-8 -*- Time Series Forest Regressor (TSF). Time series forest regressor. A time series forest is an ensemble of decision trees built on random intervals. Overview: For input data with n series of length m, for each tree: - sample sqrt(m) intervals, - find mean, std and slope for each... | 3.01756 | 3 |
vectorc2/vectorc2/settings.py | sebastiankruk/vectorc2 | 11 | 9845 | <filename>vectorc2/vectorc2/settings.py<gh_stars>10-100
"""
Django settings for vectorc2 project.
Copyright 2019 <NAME> <<EMAIL>>
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://w... | <filename>vectorc2/vectorc2/settings.py<gh_stars>10-100
"""
Django settings for vectorc2 project.
Copyright 2019 <NAME> <<EMAIL>>
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://w... | en | 0.692262 | Django settings for vectorc2 project. Copyright 2019 <NAME> <<EMAIL>> 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 app... | 1.627935 | 2 |
datahandlers/wgisd.py | mikewoodson/ssl-transfer | 0 | 9846 | <filename>datahandlers/wgisd.py
from torchvision.datasets.folder import pil_loader, accimage_loader, default_loader
from torch import Tensor
from pathlib import Path
from enum import Enum
from collections import namedtuple
from torchvision import transforms as T
import os
import numpy as np
import pdb
import functools... | <filename>datahandlers/wgisd.py
from torchvision.datasets.folder import pil_loader, accimage_loader, default_loader
from torch import Tensor
from pathlib import Path
from enum import Enum
from collections import namedtuple
from torchvision import transforms as T
import os
import numpy as np
import pdb
import functools... | en | 0.738481 | # convert box annotations from (Cx,Cy,W,H) to (X0,Y0,X1,Y1) `FGVC-Aircraft <http://www.robots.ox.ac.uk/~vgg/data/fgvc-aircraft>`_ Dataset. Args: root (string): Root directory path to dataset. transform (callable, optional): A function/transform that takes in a PIL image and returns a tra... | 2.637414 | 3 |
SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py | nikhilgk/SimpleCV | 2 | 9847 | <reponame>nikhilgk/SimpleCV<filename>SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py
#!/usr/bin/python
#
# So this script is in a bit of a hack state right now.
# This script reads
#
#
#
# Graciously copied and modified from:
# http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html
#Image queryi... | #!/usr/bin/python
#
# So this script is in a bit of a hack state right now.
# This script reads
#
#
#
# Graciously copied and modified from:
# http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html
#Image querying script written by <NAME>,
#and extended heavily James Hays
#9/26/2007 added dynamic timeslices t... | en | 0.718748 | #!/usr/bin/python # # So this script is in a bit of a hack state right now. # This script reads # # # # Graciously copied and modified from: # http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html #Image querying script written by <NAME>, #and extended heavily James Hays #9/26/2007 added dynamic timeslices to que... | 2.580182 | 3 |
Chapter04/python/2.0.0/com/sparksamples/util.py | quguiliang/Machine-Learning-with-Spark-Second-Edition | 112 | 9848 | <gh_stars>100-1000
import os
import sys
from pyspark.sql.types import *
PATH = "/home/ubuntu/work/ml-resources/spark-ml/data"
SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"
os.environ['SPARK_HOME'] = SPARK_HOME
sys.path.append(SPARK_HOME + "/python")
from pyspark import SparkContext
from pyspark import S... | import os
import sys
from pyspark.sql.types import *
PATH = "/home/ubuntu/work/ml-resources/spark-ml/data"
SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"
os.environ['SPARK_HOME'] = SPARK_HOME
sys.path.append(SPARK_HOME + "/python")
from pyspark import SparkContext
from pyspark import SparkConf
from pyspa... | none | 1 | 2.716019 | 3 | |
safemasks/resources/rest/router.py | Safemasks/safemasks-app | 1 | 9849 | """
"""
from rest_framework import routers
from safemasks.resources.rest.serializers import SupplierViewSet, TrustedSupplierViewSet
# Routers provide an easy way of automatically determining the URL conf.
ROUTER = routers.DefaultRouter()
ROUTER.register(r"suppliers", SupplierViewSet, "suppliers")
ROUTER.register(r"s... | """
"""
from rest_framework import routers
from safemasks.resources.rest.serializers import SupplierViewSet, TrustedSupplierViewSet
# Routers provide an easy way of automatically determining the URL conf.
ROUTER = routers.DefaultRouter()
ROUTER.register(r"suppliers", SupplierViewSet, "suppliers")
ROUTER.register(r"s... | en | 0.449923 | # Routers provide an easy way of automatically determining the URL conf. | 1.862375 | 2 |
src/zope/testrunner/formatter.py | jamesjer/zope.testrunner | 1 | 9850 | <reponame>jamesjer/zope.testrunner<filename>src/zope/testrunner/formatter.py
##############################################################################
#
# Copyright (c) 2004-2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Ve... | ##############################################################################
#
# Copyright (c) 2004-2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | en | 0.834808 | ############################################################################## # # Copyright (c) 2004-2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THI... | 1.851495 | 2 |
waterApp/migrations/0011_auto_20210911_1043.py | csisarep/groundwater_dashboard | 0 | 9851 | <reponame>csisarep/groundwater_dashboard
# Generated by Django 2.2 on 2021-09-11 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waterApp', '0010_auto_20210911_1041'),
]
operations = [
migrations.AlterField(
model_name... | # Generated by Django 2.2 on 2021-09-11 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waterApp', '0010_auto_20210911_1041'),
]
operations = [
migrations.AlterField(
model_name='gwmonitoring',
name='id',
... | en | 0.842887 | # Generated by Django 2.2 on 2021-09-11 04:58 | 1.446276 | 1 |
geomstats/geometry/stratified/__init__.py | shubhamtalbar96/geomstats | 0 | 9852 | """The Stratified Space Geometry Package."""
| """The Stratified Space Geometry Package."""
| en | 0.635839 | The Stratified Space Geometry Package. | 0.866009 | 1 |
src/exporter/management/commands/test_export.py | xmdy/h9eNi8F5Ut | 0 | 9853 | from django.core.management import BaseCommand
import logging
# These two lines enable debugging at httplib level (requests->urllib3->http.client)
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
# The only thing missing will be the response.body which is not logged.
... | from django.core.management import BaseCommand
import logging
# These two lines enable debugging at httplib level (requests->urllib3->http.client)
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
# The only thing missing will be the response.body which is not logged.
... | en | 0.860071 | # These two lines enable debugging at httplib level (requests->urllib3->http.client) # You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. # The only thing missing will be the response.body which is not logged. # Python 2 # You must initialize logging, otherwise you'll not ... | 2.149099 | 2 |
dask/tests/test_highgraph.py | ianthomas23/dask | 0 | 9854 | from functools import partial
import os
import pytest
import dask
import dask.array as da
from dask.utils_test import inc
from dask.highlevelgraph import HighLevelGraph, BasicLayer, Layer
from dask.blockwise import Blockwise
from dask.array.utils import assert_eq
def test_visualize(tmpdir):
pytest.importorskip(... | from functools import partial
import os
import pytest
import dask
import dask.array as da
from dask.utils_test import inc
from dask.highlevelgraph import HighLevelGraph, BasicLayer, Layer
from dask.blockwise import Blockwise
from dask.array.utils import assert_eq
def test_visualize(tmpdir):
pytest.importorskip(... | en | 0.635302 | Check map_basic_layers() by injecting an inc() call # map_basic_layers() should automatically convert it to a `BasicLayer` Check map_tasks() by injecting an +1 to the `40` literal # In order to test the default map_tasks() implementation on a Blockwise Layer, # we overwrite Blockwise.map_tasks with Layer.map_tasks | 2.164969 | 2 |
transference.py | webpwnized/cryptography | 13 | 9855 | # Requires pip install bitarray
from bitarray import bitarray
import argparse, math
def derive_transfer_function(pTransferFunctionString: str) -> list:
lTransferFunction = list(map(int, pTransferFunctionString.split(',')))
lTransferFunctionValid = True
lLengthTransferFunction = len(lTransferFunction)
... | # Requires pip install bitarray
from bitarray import bitarray
import argparse, math
def derive_transfer_function(pTransferFunctionString: str) -> list:
lTransferFunction = list(map(int, pTransferFunctionString.split(',')))
lTransferFunctionValid = True
lLengthTransferFunction = len(lTransferFunction)
... | en | 0.361015 | # Requires pip install bitarray # end if # end for # print column headers # print values for transfer function # print column headers # print row header # end looping through transfer function # end for b # end for a | 2.866055 | 3 |
tests/test_client.py | mjcaley/spamc | 0 | 9856 | import pytest
from aiospamc.client import Client
from aiospamc.exceptions import (
BadResponse,
UsageException,
DataErrorException,
NoInputException,
NoUserException,
NoHostException,
UnavailableException,
InternalSoftwareException,
OSErrorException,
OSFileException,
CantCre... | import pytest
from aiospamc.client import Client
from aiospamc.exceptions import (
BadResponse,
UsageException,
DataErrorException,
NoInputException,
NoUserException,
NoHostException,
UnavailableException,
InternalSoftwareException,
OSErrorException,
OSFileException,
CantCre... | none | 1 | 2.16609 | 2 | |
sunpy/conftest.py | tacaswell/sunpy | 0 | 9857 | <reponame>tacaswell/sunpy
import os
import tempfile
import importlib
import pytest
import astropy
import astropy.config.paths
# Force MPL to use non-gui backends for testing.
try:
import matplotlib
except ImportError:
pass
else:
matplotlib.use('Agg')
# Don't actually import pytest_remotedata because tha... | import os
import tempfile
import importlib
import pytest
import astropy
import astropy.config.paths
# Force MPL to use non-gui backends for testing.
try:
import matplotlib
except ImportError:
pass
else:
matplotlib.use('Agg')
# Don't actually import pytest_remotedata because that can do things to the
# e... | en | 0.837634 | # Force MPL to use non-gui backends for testing. # Don't actually import pytest_remotedata because that can do things to the # entrypoints code in pytest. # Do not collect the sample data file because this would download the sample data. Globally set the default config for all tests. Provide a way to add local files to... | 2.140099 | 2 |
qtcalendar/models.py | asmateus/PyQtCalendar | 7 | 9858 | '''
Models for QtWidgets
'''
from collections import deque
from math import ceil
import datetime as dt
import calendar
class EventInCalendar__Model:
class Text:
@staticmethod
def getDefault():
return EventInCalendar__Model.Text()
def __init__(self, event=None, overflow=Fal... | '''
Models for QtWidgets
'''
from collections import deque
from math import ceil
import datetime as dt
import calendar
class EventInCalendar__Model:
class Text:
@staticmethod
def getDefault():
return EventInCalendar__Model.Text()
def __init__(self, event=None, overflow=Fal... | en | 0.864603 | Models for QtWidgets Returns the day of the week of a given date and the position of that day in the calendar grid. The returned text value of the day is recovered from the stringer module. # Get the day of the week of the selected date # Horizontal position in the grid is deduced from the selec... | 2.720298 | 3 |
python/orca/src/bigdl/orca/data/tf/data.py | Forest216/BigDL | 0 | 9859 | #
# Copyright 2016 The BigDL Authors.
#
# 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 ... | #
# Copyright 2016 The BigDL Authors.
#
# 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 ... | en | 0.882935 | # # Copyright 2016 The BigDL Authors. # # 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 ... | 2.094136 | 2 |
tools/generate_serialization_header.py | StableCoder/vulkan-mini-libs-2 | 1 | 9860 | <gh_stars>1-10
#!/usr/bin/env python3
import sys
import getopt
import xml.etree.ElementTree as ET
def processVendors(outFile, vendors):
outFile.writelines(["\nconstexpr std::array<std::string_view, ", str(
len(vendors)), "> vendors = {{\n"])
for vendor in vendors:
outFile.writelines([' \"', ... | #!/usr/bin/env python3
import sys
import getopt
import xml.etree.ElementTree as ET
def processVendors(outFile, vendors):
outFile.writelines(["\nconstexpr std::array<std::string_view, ", str(
len(vendors)), "> vendors = {{\n"])
for vendor in vendors:
outFile.writelines([' \"', vendor.tag, '\"... | en | 0.324926 | #!/usr/bin/env python3 # Spitting out plain values # Bitflag # Skip VkResult # Skip if there's no values, MSVC can't do zero-sized arrays # Determine how much to chop off the front # Determine if type ends with vendor tag # Construct most likely enum prefix # Common Header # #ifndef VK_VALUE_SERIALIZATION_HPP #define V... | 2.413119 | 2 |
ampel/cli/AbsStockCommand.py | AmpelProject/Ampel-core | 5 | 9861 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-core/ampel/cli/AbsStockCommand.py
# License : BSD-3-Clause
# Author : vb <<EMAIL>>
# Date : 25.03.2021
# Last Modified Date: 25.03.2021
# Last Modified By : vb <<EMAIL>>
from typing import Dict, Any, Optional, ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-core/ampel/cli/AbsStockCommand.py
# License : BSD-3-Clause
# Author : vb <<EMAIL>>
# Date : 25.03.2021
# Last Modified Date: 25.03.2021
# Last Modified By : vb <<EMAIL>>
from typing import Dict, Any, Optional, ... | en | 0.36907 | #!/usr/bin/env python # -*- coding: utf-8 -*- # File : Ampel-core/ampel/cli/AbsStockCommand.py # License : BSD-3-Clause # Author : vb <<EMAIL>> # Date : 25.03.2021 # Last Modified Date: 25.03.2021 # Last Modified By : vb <<EMAIL>> Base class for commands selecting/matchin... | 1.95767 | 2 |
programmers/lv2/42888.py | KLumy/Basic-Algorithm | 1 | 9862 | from typing import List
def solution(records: List[str]):
logger = []
id_name = dict()
message = {"Enter": "님이 들어왔습니다.", "Leave": "님이 나갔습니다."}
for record in records:
op, id, *name = record.split()
if name:
id_name[id] = name[0]
if op in message:
logger.... | from typing import List
def solution(records: List[str]):
logger = []
id_name = dict()
message = {"Enter": "님이 들어왔습니다.", "Leave": "님이 나갔습니다."}
for record in records:
op, id, *name = record.split()
if name:
id_name[id] = name[0]
if op in message:
logger.... | none | 1 | 3.420058 | 3 | |
app/nets.py | bobosoft/intrepyd | 2 | 9863 | <reponame>bobosoft/intrepyd
"""
Implementation of REST API for nets creation
"""
from flask import Blueprint, request
from .utils import typename_to_type
from .contexts import contexts
nr = Blueprint('nets', __name__)
def _create_bool_constant(func):
context = request.get_json()['context']
if context is None:... | """
Implementation of REST API for nets creation
"""
from flask import Blueprint, request
from .utils import typename_to_type
from .contexts import contexts
nr = Blueprint('nets', __name__)
def _create_bool_constant(func):
context = request.get_json()['context']
if context is None:
return {'result': '... | en | 0.707029 | Implementation of REST API for nets creation Gets the list of the available nets Creates the net true Creates the net false Creates a number Creates a logical not Creates an arithmetic minus Creates a logical and Creates a logical or Creates a logical implies Creates a logical xor Creates a logical iff Creates an addit... | 2.647399 | 3 |
tensorflow_addons/image/utils.py | Soroosh129/addons | 1 | 9864 | <gh_stars>1-10
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.792074 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.354988 | 2 |
tests/test_charge.py | fossabot/MolVS | 1 | 9865 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for charge.py"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging
from rdkit import Chem
from molvs.standardize import Standardizer, standardize_smiles
from molvs.charge i... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for charge.py"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging
from rdkit import Chem
from molvs.standardize import Standardizer, standardize_smiles
from molvs.charge import Reionizer... | en | 0.55616 | #!/usr/bin/env python # -*- coding: utf-8 -*- Tests for charge.py Utility function that returns the charge parent SMILES for given a SMILES string. Test neutralization of ionized acids and bases. Test preservation of zwitterion. Choline should be left with a positive charge. This should have the hydrogen removed to giv... | 2.385386 | 2 |
backend/users/views.py | jochanmin/Blog | 11 | 9866 | <reponame>jochanmin/Blog
from django.shortcuts import render
from django.core import serializers
from .models import User
from django.forms.models import model_to_dict
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from r... | from django.shortcuts import render
from django.core import serializers
from .models import User
from django.forms.models import model_to_dict
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions... | ko | 0.982314 | #회원가입 /users/auth/ #아이디를 등록하는곳 /users/register # 토큰을 주면 해당 유저의 정보를 얻는 곳 /users/users | 2.054309 | 2 |
src/test/test_Location.py | MrRollyPanda/astral | 0 | 9867 | # -*- coding: utf-8 -*-
from pytest import raises
from astral import Astral, AstralError, Location
import datetime
import pytz
def datetime_almost_equal(datetime1, datetime2, seconds=60):
dd = datetime1 - datetime2
sd = (dd.days * 24 * 60 * 60) + dd.seconds
return abs(sd) <= seconds
def test_Location_N... | # -*- coding: utf-8 -*-
from pytest import raises
from astral import Astral, AstralError, Location
import datetime
import pytz
def datetime_almost_equal(datetime1, datetime2, seconds=60):
dd = datetime1 - datetime2
sd = (dd.days * 24 * 60 * 60) + dd.seconds
return abs(sd) <= seconds
def test_Location_N... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.464534 | 2 |
__init__.py | minjunli/jsonc | 2 | 9868 | from .jsonc import load, loads, dump, dumps
| from .jsonc import load, loads, dump, dumps
| none | 1 | 1.081979 | 1 | |
specs/d3d9caps.py | prahal/apitrace | 1 | 9869 | ##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | ##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software withou... | en | 0.70016 | ########################################################################## # # Copyright 2008-2009 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software withou... | 1.348868 | 1 |
miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py | NimBuzz01/Project-Miika_SDGP | 0 | 9870 | <reponame>NimBuzz01/Project-Miika_SDGP<filename>miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py<gh_stars>0
__version__ = '4.64.0'
| __version__ = '4.64.0' | none | 1 | 1.085728 | 1 | |
gym_flock/envs/old/mapping.py | katetolstaya/gym-flock | 19 | 9871 | import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family': 'sans-serif',
'weight': 'bold',
'size': 14}
class MappingEnv(gym.Env):
def ... | import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family': 'sans-serif',
'weight': 'bold',
'size': 14}
class MappingEnv(gym.Env):
def ... | en | 0.39434 | # config_file = path.join(path.dirname(__file__), "params_flock.cfg") # config = configparser.ConfigParser() # config.read(config_file) # config = config['flock'] # normalize the adjacency matrix by the number of neighbors or not # number states per agent # number of actions per agent # default problem parameters # int... | 2.339267 | 2 |
tensorflow/python/kernel_tests/lu_op_test.py | PaulWang1905/tensorflow | 36 | 9872 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.825738 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 2.027581 | 2 |
aligner/features/processing.py | zhouyangnk/Montreal-Forced-Aligner | 1 | 9873 | import multiprocessing as mp
import subprocess
import shutil
import os
from ..helper import make_path_safe, thirdparty_binary, filter_scp
from ..exceptions import CorpusError
def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover
log_directory = os.path.join(directory, 'log')
raw_mfcc_path... | import multiprocessing as mp
import subprocess
import shutil
import os
from ..helper import make_path_safe, thirdparty_binary, filter_scp
from ..exceptions import CorpusError
def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover
log_directory = os.path.join(directory, 'log')
raw_mfcc_path... | en | 0.695262 | # pragma: no cover Multiprocessing function that converts wav files into MFCCs See http://kaldi-asr.org/doc/feat.html and http://kaldi-asr.org/doc/compute-mfcc-feats_8cc.html for more details on how MFCCs are computed. Also see https://github.com/kaldi-asr/kaldi/blob/master/egs/wsj/s5/steps/make_mfcc.... | 2.135553 | 2 |
ffai/util/bothelper.py | tysen2k/ffai | 0 | 9874 | """
A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by
the client
"""
from ffai.core import Game, Action, ActionType
from ffai.core.procedure import *
from ffai.util.pathfinding import *
from typing import Optional, List, Dict
class ActionSequence:
... | """
A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by
the client
"""
from ffai.core import Game, Action, ActionType
from ffai.core.procedure import *
from ffai.util.pathfinding import *
from typing import Optional, List, Dict
class ActionSequence:
... | en | 0.805699 | A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by the client Creates a new ActionSequence - an ordered list of sequential Actions to attempt to undertake. :param action_steps: Sequence of action steps that form this action. :param score... | 3.358604 | 3 |
sb_backend/cli/cli.py | DmitriyGrigoriev/sb-fastapi | 0 | 9875 | # -*- coding: utf-8 -*-
"""sb-fastapi CLI root."""
import logging
import click
from sb_backend.cli.commands.serve import serve
@click.group()
@click.option(
"-v",
"--verbose",
help="Enable verbose logging.",
is_flag=True,
default=False,
)
def cli(**options):
"""sb-fastapi CLI root."""
if ... | # -*- coding: utf-8 -*-
"""sb-fastapi CLI root."""
import logging
import click
from sb_backend.cli.commands.serve import serve
@click.group()
@click.option(
"-v",
"--verbose",
help="Enable verbose logging.",
is_flag=True,
default=False,
)
def cli(**options):
"""sb-fastapi CLI root."""
if ... | en | 0.396647 | # -*- coding: utf-8 -*- sb-fastapi CLI root. sb-fastapi CLI root. | 2.063007 | 2 |
1-Chapter/htmlcomponents.py | DSandovalFlavio/Dashboards-Plotly-Dash | 0 | 9876 | import dash
from dash import html
app = dash.Dash(__name__)
app.layout = html.Div(children=[html.H1('Data Science',
style = {'textAlign': 'center',
'color': '#0FD08D',
'font-size': '... | import dash
from dash import html
app = dash.Dash(__name__)
app.layout = html.Div(children=[html.H1('Data Science',
style = {'textAlign': 'center',
'color': '#0FD08D',
'font-size': '... | none | 1 | 2.746451 | 3 | |
baadalinstallation/baadal/modules/vm_helper.py | iitd-plos/baadal2.0 | 8 | 9877 | # -*- coding: utf-8 -*-
###################################################################################
from gluon import current
from helper import get_constant, execute_remote_cmd, config, get_datetime, \
log_exception, is_pingable, get_context_path
from libvirt import * # @UnusedWildImport
from log_handler ... | # -*- coding: utf-8 -*-
###################################################################################
from gluon import current
from helper import get_constant, execute_remote_cmd, config, get_datetime, \
log_exception, is_pingable, get_context_path
from libvirt import * # @UnusedWildImport
from log_handler ... | en | 0.737981 | # -*- coding: utf-8 -*- ################################################################################### # @UnusedWildImport Chooses datastore from a list of available datastores # datastore_capacity = current.db(current.db.datastore.id >= 0).select(orderby = current.db.datastore.used Returns resources utilization o... | 2.006606 | 2 |
third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py | bopopescu/webrtc-streaming-node | 8 | 9878 | <reponame>bopopescu/webrtc-streaming-node
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib... | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module wraps the Android Asset Packaging Tool."""
import os
from devil.utils import cmd_helper
from pylib import constants
_AAPT_PATH = os.path.jo... | en | 0.81449 | # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. This module wraps the Android Asset Packaging Tool. Runs an aapt command. Args: args: A list of arguments for aapt. Returns: The output of the c... | 2.458751 | 2 |
examples/Tests/Misc/Resources/PythonFile/basic.py | esayui/mworks | 0 | 9879 | <reponame>esayui/mworks
setvar('nsamples', getvar('a') + getvar('b'))
| setvar('nsamples', getvar('a') + getvar('b')) | none | 1 | 1.063795 | 1 | |
quacc/recipes/psi4/core.py | arosen93/HT-ASE | 9 | 9880 | <filename>quacc/recipes/psi4/core.py
"""Core recipes for Psi4"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict
from ase.atoms import Atoms
from ase.calculators.psi4 import Psi4
from jobflow import Maker, job
from monty.dev import requires
try:
import psi4
excep... | <filename>quacc/recipes/psi4/core.py
"""Core recipes for Psi4"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict
from ase.atoms import Atoms
from ase.calculators.psi4 import Psi4
from jobflow import Maker, job
from monty.dev import requires
try:
import psi4
excep... | en | 0.720651 | Core recipes for Psi4 Class to carry out a single-point calculation. Parameters ---------- name Name of the job. method The level of theory to use. basis Basis set swaps Dictionary of custom kwargs for the calculator. Make the run. Parameters ---... | 2.075814 | 2 |
UAS/UAS 11 & 12/main.py | Archedar/UAS | 0 | 9881 | #Main Program
from Class import Barang
import Menu
histori = list()
listBarang = [
Barang('Rinso', 5000, 20),
Barang('Sabun', 3000, 20),
Barang('Pulpen', 2500, 20),
Barang('Tisu', 10000, 20),
Barang('Penggaris', 1000, 20)
]
while True:
print('''
Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Ta... | #Main Program
from Class import Barang
import Menu
histori = list()
listBarang = [
Barang('Rinso', 5000, 20),
Barang('Sabun', 3000, 20),
Barang('Pulpen', 2500, 20),
Barang('Tisu', 10000, 20),
Barang('Penggaris', 1000, 20)
]
while True:
print('''
Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Ta... | id | 0.354467 | #Main Program Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Tambah Stock Barang
4. Hapus Barang
5. Cari Barang Berdasarkan Keyword
6. Hitung Barang Belanjaan
7. Histori Keluar Masuk Barang
0. Keluar Program | 3.72465 | 4 |
original/baselines/train/JointE+ONE.py | thunlp/JointNRE | 186 | 9882 | #coding:utf-8
import numpy as np
import tensorflow as tf
import os
import time
import datetime
import ctypes
import threading
import json
ll1 = ctypes.cdll.LoadLibrary
lib_cnn = ll1("./init_cnn.so")
ll2 = ctypes.cdll.LoadLibrary
lib_kg = ll2("./init_know.so")
class Config(object):
def __init__(self):
self.in... | #coding:utf-8
import numpy as np
import tensorflow as tf
import os
import time
import datetime
import ctypes
import threading
import json
ll1 = ctypes.cdll.LoadLibrary
lib_cnn = ll1("./init_cnn.so")
ll2 = ctypes.cdll.LoadLibrary
lib_kg = ll2("./init_know.so")
class Config(object):
def __init__(self):
self.in... | en | 0.771487 | #coding:utf-8 #230 #know #cnn | 2.180449 | 2 |
i2vec_cli/__main__.py | rachmadaniHaryono/i2vec_cli | 0 | 9883 | #!/usr/bin/env python3
"""get tag from http://demo.illustration2vec.net/."""
# note:
# - error 'ERROR: Request Entity Too Large' for file 1.1 mb
# <span style="color:red;">ERROR: Request Entity Too Large</span>
from collections import OrderedDict
from pathlib import Path
from pprint import pformat
import imghdr
import ... | #!/usr/bin/env python3
"""get tag from http://demo.illustration2vec.net/."""
# note:
# - error 'ERROR: Request Entity Too Large' for file 1.1 mb
# <span style="color:red;">ERROR: Request Entity Too Large</span>
from collections import OrderedDict
from pathlib import Path
from pprint import pformat
import imghdr
import ... | en | 0.580715 | #!/usr/bin/env python3 get tag from http://demo.illustration2vec.net/. # note: # - error 'ERROR: Request Entity Too Large' for file 1.1 mb # <span style="color:red;">ERROR: Request Entity Too Large</span> Return True if path is url, False otherwise. compare file extension with result from imghdr_ext. download url. ... | 2.600625 | 3 |
cherrypy/lib/cptools.py | debrando/cherrypy | 2 | 9884 | """Functions for builtin CherryPy tools."""
import logging
import re
from hashlib import md5
import six
from six.moves import urllib
import cherrypy
from cherrypy._cpcompat import text_or_bytes
from cherrypy.lib import httputil as _httputil
from cherrypy.lib import is_iterator
# Conditional HTT... | """Functions for builtin CherryPy tools."""
import logging
import re
from hashlib import md5
import six
from six.moves import urllib
import cherrypy
from cherrypy._cpcompat import text_or_bytes
from cherrypy.lib import httputil as _httputil
from cherrypy.lib import is_iterator
# Conditional HTT... | en | 0.775416 | Functions for builtin CherryPy tools. # Conditional HTTP request support # Validate the current ETag against If-Match, If-None-Match headers. If autotags is True, an ETag response-header value will be provided from an MD5 hash of the response body (unless some other code... | 2.398516 | 2 |
pyiomica/utilityFunctions.py | benstear/pyiomica | 0 | 9885 | '''Utility functions'''
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
'''Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
... | '''Utility functions'''
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
'''Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
... | en | 0.485753 | Utility functions Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
Returns:
data
Python data
Usage:
data = readMathIOmicaData("../../MathIOmica/Ma... | 2.947515 | 3 |
CRNitschke/get_sextract_thresholds.py | deapplegate/wtgpipeline | 1 | 9886 | <reponame>deapplegate/wtgpipeline
#! /usr/bin/env python
#adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection
#adam-use# use with CRNitschke pipeline
#adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_fil... | #! /usr/bin/env python
#adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection
#adam-use# use with CRNitschke pipeline
#adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_file.txt
#IO stuff:
import sys ; sys... | en | 0.579151 | #! /usr/bin/env python #adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection #adam-use# use with CRNitschke pipeline #adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_file.txt #IO stuff: ###saveout = sys.... | 2.27265 | 2 |
python/labbox/api/_session.py | flatironinstitute/labbox | 1 | 9887 | <filename>python/labbox/api/_session.py
import time
import multiprocessing
class Session:
def __init__(self, *, labbox_config, default_feed_name: str):
self._labbox_config = labbox_config
pipe_to_parent, pipe_to_child = multiprocessing.Pipe()
self._worker_process = multiprocessing.Process... | <filename>python/labbox/api/_session.py
import time
import multiprocessing
class Session:
def __init__(self, *, labbox_config, default_feed_name: str):
self._labbox_config = labbox_config
pipe_to_parent, pipe_to_child = multiprocessing.Pipe()
self._worker_process = multiprocessing.Process... | none | 1 | 2.463666 | 2 | |
aldryn_newsblog/tests/test_reversion.py | GabrielDumbrava/aldryn-newsblog | 0 | 9888 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipIf
try:
from django.core.urlresolvers import reverse
except ModuleNotFoundError:
from django.urls import reverse
from django.db import transaction
from aldryn_reversion.core import create_revision as aldryn_create_revisio... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipIf
try:
from django.core.urlresolvers import reverse
except ModuleNotFoundError:
from django.urls import reverse
from django.db import transaction
from aldryn_reversion.core import create_revision as aldryn_create_revisio... | en | 0.664263 | # -*- coding: utf-8 -*- # TODO: Cover both cases (plugin modification/recreation) # if content: # article.content.get_plugins().delete() # api.add_plugin(article.content, 'TextPlugin', # self.language, body=content) # Revision 1 # Revision 2 # Revert to revision 1 # Revision 1 # Revision 2a (... | 2.237348 | 2 |
network/network.py | VirtualEmbryo/lumen_network | 1 | 9889 | # Library for the dynamics of a lumen network
# The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes
#
# Created by <NAME>, 2018
# Modified by <NAME>--Serandour on 8/04/2019
"""
network.py conf.init
Defines the class network and associated functions
Imports
-------... | # Library for the dynamics of a lumen network
# The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes
#
# Created by <NAME>, 2018
# Modified by <NAME>--Serandour on 8/04/2019
"""
network.py conf.init
Defines the class network and associated functions
Imports
-------... | en | 0.620598 | # Library for the dynamics of a lumen network # The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes # # Created by <NAME>, 2018 # Modified by <NAME>--Serandour on 8/04/2019 network.py conf.init Defines the class network and associated functions Imports ------- Libr... | 2.933927 | 3 |
scripts/upsampling_demo.py | always-newbie161/pyprobml | 2 | 9890 | # Illustrate upsampling in 2d
# Code from <NAME>
# https://machinelearningmastery.com/generative_adversarial_networks/
import tensorflow as tf
from tensorflow import keras
from numpy import asarray
#from keras.models import Sequential
from tensorflow.keras.models import Sequential
#from keras.layers import UpSampl... | # Illustrate upsampling in 2d
# Code from <NAME>
# https://machinelearningmastery.com/generative_adversarial_networks/
import tensorflow as tf
from tensorflow import keras
from numpy import asarray
#from keras.models import Sequential
from tensorflow.keras.models import Sequential
#from keras.layers import UpSampl... | en | 0.740191 | # Illustrate upsampling in 2d # Code from <NAME> # https://machinelearningmastery.com/generative_adversarial_networks/ #from keras.models import Sequential #from keras.layers import UpSampling2D # reshape input data into one sample a sample with a channel # nearest neighbor | 3.241031 | 3 |
V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py | njchj/V2RayCloudSpider | 1 | 9891 | <gh_stars>1-10
__all__ = ['scaffold', 'command_set']
from gevent import monkey
monkey.patch_all()
import csv
import os
import sys
import time
import shutil
from typing import List
import gevent
from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \
REDIS_MASTER, SERVER_DIR_DAT... | __all__ = ['scaffold', 'command_set']
from gevent import monkey
monkey.patch_all()
import csv
import os
import sys
import time
import shutil
from typing import List
import gevent
from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \
REDIS_MASTER, SERVER_DIR_DATABASE_CACHE, SE... | zh | 0.323723 | # --------------------------------------------- # 部署接口 # --------------------------------------------- # --------------------------------------------- # 调试接口 # --------------------------------------------- # --------------------------------------------- # 随参调试接口 # --------------------------------------------- # usage: ... | 1.553839 | 2 |
python/swap_header.py | daniestevez/gr-csp | 19 | 9892 | <reponame>daniestevez/gr-csp<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 <NAME> <<EMAIL>>.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source co... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 <NAME> <<EMAIL>>.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any pu... | en | 0.800403 | #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 <NAME> <<EMAIL>>. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any pur... | 1.677587 | 2 |
start.py | gleenn/dfplayer | 0 | 9893 | <gh_stars>0
#!/usr/bin/python
#
# Start dfplayer.
import argparse
import os
import shutil
import subprocess
import sys
import time
_PROJ_DIR = os.path.dirname(__file__)
def main():
os.chdir(_PROJ_DIR)
os.environ['LD_LIBRARY_PATH'] = '/lib:/usr/lib:/usr/local/lib'
arg_parser = argparse.ArgumentParser(descr... | #!/usr/bin/python
#
# Start dfplayer.
import argparse
import os
import shutil
import subprocess
import sys
import time
_PROJ_DIR = os.path.dirname(__file__)
def main():
os.chdir(_PROJ_DIR)
os.environ['LD_LIBRARY_PATH'] = '/lib:/usr/lib:/usr/local/lib'
arg_parser = argparse.ArgumentParser(description='Star... | en | 0.116066 | #!/usr/bin/python # # Start dfplayer. #['gdb', '--args', 'env/bin/python'] + params) | 2.114605 | 2 |
Game_Mechanics.py | Finnder/Console-Based-Story-Game | 0 | 9894 | <gh_stars>0
def attack():
pass
def defend():
pass
def pass_turn():
pass
def use_ability_One(kit):
pass
def use_ability_Two(kit):
pass
def end_Of_Battle():
pass | def attack():
pass
def defend():
pass
def pass_turn():
pass
def use_ability_One(kit):
pass
def use_ability_Two(kit):
pass
def end_Of_Battle():
pass | none | 1 | 1.345189 | 1 | |
AIY/voice/cloudspeech_demo.py | Pougnator/Prometheus | 0 | 9895 | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | en | 0.793099 | #!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or... | 2.343847 | 2 |
options/base_option.py | lime-j/YTMT-Strategy-1 | 26 | 9896 | <reponame>lime-j/YTMT-Strategy-1
import argparse
import models
model_names = sorted(name for name in models.__dict__
if name.islower() and not name.startswith("__")
and callable(models.__dict__[name]))
class BaseOptions():
def __init__(self):
self.parser = argpar... | import argparse
import models
model_names = sorted(name for name in models.__dict__
if name.islower() and not name.startswith("__")
and callable(models.__dict__[name]))
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser(formatter_class... | en | 0.477176 | # experiment specifics # for setting input # for display | 2.54937 | 3 |
bookstore/__init__.py | JanhaviSoni/Book-Recommendation-Analysis | 23 | 9897 |
from flask import Flask, Response
from flask_basicauth import BasicAuth
from flask_cors import CORS, cross_origin
import os
#from flask_admin import Admin,AdminIndexView
#from flask_admin.contrib.sqla import ModelView
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
from flask_migrate import Migrate, Migr... |
from flask import Flask, Response
from flask_basicauth import BasicAuth
from flask_cors import CORS, cross_origin
import os
#from flask_admin import Admin,AdminIndexView
#from flask_admin.contrib.sqla import ModelView
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
from flask_migrate import Migrate, Migr... | en | 0.679402 | #from flask_admin import Admin,AdminIndexView #from flask_admin.contrib.sqla import ModelView # import psycopg2 # import pymysql # import logging # import warnings # warnings.filterwarnings("ignore") # Initializing Flask App # This video demonstrates why we use CORS in our Flask App - https://www.youtube.com/watch?v=vW... | 2.505414 | 3 |
cobl/lexicon/management/commands/stats236.py | Bibiko/CoBL-public | 0 | 9898 | <reponame>Bibiko/CoBL-public<filename>cobl/lexicon/management/commands/stats236.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management import BaseCommand
from cobl.lexicon.models import LanguageList, \
MeaningList, \
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management import BaseCommand
from cobl.lexicon.models import LanguageList, \
MeaningList, \
Meaning, \
Lexeme, \
... | en | 0.786243 | # -*- coding: utf-8 -*- # Data to work with: # Only without root_form is wanted. # Computing ._cognateClasses for each clade: # Removing cognate class IDs we don't want: # Setting ._cognateClassIds for current clade: # Updating children: # Creating .txt files: # Grouping by meaning: # Composing markdown: # Writing if c... | 2.026529 | 2 |
collation/test2.py | enabling-languages/dinka | 1 | 9899 | <filename>collation/test2.py<gh_stars>1-10
import pandas as pd
from icu import Collator, Locale, RuleBasedCollator
ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5))
collator = Collator.createInstance(Locale('en_AU.UTF-8'))
# https://stackoverflow.com/questions/13838405/custom-sor... | <filename>collation/test2.py<gh_stars>1-10
import pandas as pd
from icu import Collator, Locale, RuleBasedCollator
ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5))
collator = Collator.createInstance(Locale('en_AU.UTF-8'))
# https://stackoverflow.com/questions/13838405/custom-sor... | en | 0.524828 | # https://stackoverflow.com/questions/13838405/custom-sorting-in-pandas-dataframe/27009771#27009771 # https://gist.github.com/seanpue/e1cb846f676194ae77eb #ddf.iloc[sort_by_custom_dict(ddf.index)] # ddf.iloc[sort_by_custom_dict(ddf['Form'])] #https://python3.wannaphong.com/2015/03/sort-python.html # https://pyerror.com... | 2.895085 | 3 |