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
sbx/ui/controls.py
JaDogg/sbx
4
6623651
""" Reusable controls, components, classes used in SBX """ import abc from abc import ABCMeta from prompt_toolkit import Application from prompt_toolkit.clipboard import ClipboardData from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.layout import Layout from prompt_toolkit.layout.containers impo...
""" Reusable controls, components, classes used in SBX """ import abc from abc import ABCMeta from prompt_toolkit import Application from prompt_toolkit.clipboard import ClipboardData from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.layout import Layout from prompt_toolkit.layout.containers impo...
en
0.656342
Reusable controls, components, classes used in SBX Pre configured markdown component for prompt_toolkit Insert a tab Core UI class for Editor & Study interfaces to inherit from Hide current displayed dialog box # Nothing to hide, ignore # WHY: Ensure that we restore previous focused item # Garbage clean up Show a mess...
2.355313
2
prf_api/arquivo.py
nymarya/prf_api
6
6623652
from io import BytesIO from zipfile import ZipFile from rarfile import RarFile import os def extrair_rar(rf: RarFile, caminho: str): """ Extrai csvs de um arquivo . rar. Parâmetros ---------- rf: Rarfile conteúdo do arquivo compactado. caminho: str caminho para pasta onde os arqui...
from io import BytesIO from zipfile import ZipFile from rarfile import RarFile import os def extrair_rar(rf: RarFile, caminho: str): """ Extrai csvs de um arquivo . rar. Parâmetros ---------- rf: Rarfile conteúdo do arquivo compactado. caminho: str caminho para pasta onde os arqui...
pt
0.859976
Extrai csvs de um arquivo . rar. Parâmetros ---------- rf: Rarfile conteúdo do arquivo compactado. caminho: str caminho para pasta onde os arquivos devem ser salvos. # Filtra arquivos csvs comprimidos Extrai csvs de um arquivo .zip. Parâmetros ---------- zp: ZipFile ...
3.224482
3
SIGCOMM_2016/heavy_hitter/receive.py
ptcrews/p4-mininet-tutorials
23
6623653
<gh_stars>10-100 #!/usr/bin/python # Copyright 2013-present Barefoot Networks, 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 # # Unle...
#!/usr/bin/python # Copyright 2013-present Barefoot Networks, 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 ap...
en
0.831285
#!/usr/bin/python # Copyright 2013-present Barefoot Networks, 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 app...
2.361855
2
desafio1.py
elizabethesantos/Python3-Curso-em-video
1
6623654
nome=input('Qual é seu nome?') print(nome+'! Prazer em te conhecer!')
nome=input('Qual é seu nome?') print(nome+'! Prazer em te conhecer!')
none
1
3.464713
3
pygsuite/drive/__init__.py
gitter-badger/pygsuite
0
6623655
from .drive import Drive, FileTypes __all__ = ["Drive", "FileTypes"]
from .drive import Drive, FileTypes __all__ = ["Drive", "FileTypes"]
none
1
1.454287
1
mgxsim/genome_index.py
patrickwest/mgx-sim
0
6623656
from typing import Callable, List, Union from abc import abstractmethod from pathlib import Path import pandas as pd from .genome import Genome class GenomeIndex: def __init__(self): self.metadata = None @abstractmethod def build_index(self) -> pd.DataFrame: pass def __getitem__(s...
from typing import Callable, List, Union from abc import abstractmethod from pathlib import Path import pandas as pd from .genome import Genome class GenomeIndex: def __init__(self): self.metadata = None @abstractmethod def build_index(self) -> pd.DataFrame: pass def __getitem__(s...
none
1
2.834124
3
dkist/io/tests/test_fits.py
DKISTDC/dkist
21
6623657
from pathlib import Path import numpy as np import pytest from numpy.testing import assert_allclose import asdf from dkist.data.test import rootdir from dkist.io.file_manager import FileManager from dkist.io.loaders import AstropyFITSLoader eitdir = Path(rootdir) / 'EIT' @pytest.fixture def relative_ear(): re...
from pathlib import Path import numpy as np import pytest from numpy.testing import assert_allclose import asdf from dkist.data.test import rootdir from dkist.io.file_manager import FileManager from dkist.io.loaders import AstropyFITSLoader eitdir = Path(rootdir) / 'EIT' @pytest.fixture def relative_ear(): re...
none
1
2.066391
2
vqa_txt_data/get_answers.py
billyang98/UNITER
0
6623658
<reponame>billyang98/UNITER<gh_stars>0 import json from lz4.frame import compress, decompress import lmdb import msgpack import numpy as np from tqdm import tqdm f_name = '/scratch/cluster/billyang/vqa_dataset/txt_db/oov_datasets/oov_test_set.db' print("Doing {}".format(f_name)) env = lmdb.open(f_name, readonly=True, ...
import json from lz4.frame import compress, decompress import lmdb import msgpack import numpy as np from tqdm import tqdm f_name = '/scratch/cluster/billyang/vqa_dataset/txt_db/oov_datasets/oov_test_set.db' print("Doing {}".format(f_name)) env = lmdb.open(f_name, readonly=True, create=True, map_size=4*1024**4) txn = ...
none
1
2.207752
2
harnessed_jobs/tearing_detection/v0/producer_tearing_detection.py
duncanwood/EO-analysis-jobs
2
6623659
<reponame>duncanwood/EO-analysis-jobs<gh_stars>1-10 #!/usr/bin/env ipython """ Producer script for raft-level flat pairs analysis. """ def run_tearing_detection(sensor_id): """ Loop over the acquisition jobs and perform tearing analysis on each. """ import pickle import lsst.eotest.image_utils as i...
#!/usr/bin/env ipython """ Producer script for raft-level flat pairs analysis. """ def run_tearing_detection(sensor_id): """ Loop over the acquisition jobs and perform tearing analysis on each. """ import pickle import lsst.eotest.image_utils as imutils import lsst.eotest.sensor as sensorTest ...
en
0.702006
#!/usr/bin/env ipython Producer script for raft-level flat pairs analysis. Loop over the acquisition jobs and perform tearing analysis on each. # Create a super bias frame. # Reserve 1 process per CCD. # Divisidero tearing analysis.
2.318041
2
fabfile.py
azkarmoulana/pycon
154
6623660
import json import os import re from fabric.api import cd, env, get, hide, local, put, require, run, settings, sudo, task from fabric.colors import red from fabric.contrib import files, project from fabric.utils import abort, error # Directory structure PROJECT_ROOT = os.path.dirname(__file__) env.project = 'pycon' e...
import json import os import re from fabric.api import cd, env, get, hide, local, put, require, run, settings, sudo, task from fabric.colors import red from fabric.contrib import files, project from fabric.utils import abort, error # Directory structure PROJECT_ROOT = os.path.dirname(__file__) env.project = 'pycon' e...
en
0.786331
# Directory structure Run a Django management command on the remote server. # Need custom code for dbshell to work Drop into the remote Django shell. Deploy to a given environment. # NOTE: salt will check every 15 minutes whether the # repo has changed, and if so, redeploy. Or you can use this # to make it run immedia...
2.068181
2
links/views.py
moshthepitt/product.co.ke
1
6623661
<reponame>moshthepitt/product.co.ke<filename>links/views.py from django.views.generic.edit import CreateView from django.views.generic.edit import UpdateView from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.views.generic.edit import DeleteView from django.cor...
from django.views.generic.edit import CreateView from django.views.generic.edit import UpdateView from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.views.generic.edit import DeleteView from django.core.urlresolvers import reverse_lazy from django.utils.transla...
none
1
2.081106
2
server/books/api/views.py
zubeir68/my-library
0
6623662
<filename>server/books/api/views.py<gh_stars>0 from rest_framework import generics, mixins from books.models import Book from .serializers import bookSerializer class bookAPIView(mixins.CreateModelMixin, generics.ListAPIView): resource_name = 'books' serializer_class = bookSerializer serializer_class = bookSer...
<filename>server/books/api/views.py<gh_stars>0 from rest_framework import generics, mixins from books.models import Book from .serializers import bookSerializer class bookAPIView(mixins.CreateModelMixin, generics.ListAPIView): resource_name = 'books' serializer_class = bookSerializer serializer_class = bookSer...
none
1
2.283364
2
2020/14/14-python.py
allengarvin/adventofcode
0
6623663
#!/usr/bin/python import sys, os, argparse, operator, re from parse import parse def apply_mask1(num, mask): num |= mask[0] num &= mask[1] return num def apply_mask2(addr, num, mask, core): masks = [0] for n, b in enumerate(mask[0]): if b == "X": for m in masks[:]: ...
#!/usr/bin/python import sys, os, argparse, operator, re from parse import parse def apply_mask1(num, mask): num |= mask[0] num &= mask[1] return num def apply_mask2(addr, num, mask, core): masks = [0] for n, b in enumerate(mask[0]): if b == "X": for m in masks[:]: ...
ru
0.258958
#!/usr/bin/python
2.988604
3
tests/krankshaft/test_serializer.py
VeritasOS/krankshaft
0
6623664
<gh_stars>0 from __future__ import absolute_import from datetime import date, datetime, time, timedelta from decimal import Decimal from django.core.handlers.wsgi import WSGIRequest from django.test.client import FakePayload from krankshaft.serializer import Serializer from tests.base import TestCaseNoDB from urlparse...
from __future__ import absolute_import from datetime import date, datetime, time, timedelta from decimal import Decimal from django.core.handlers.wsgi import WSGIRequest from django.test.client import FakePayload from krankshaft.serializer import Serializer from tests.base import TestCaseNoDB from urlparse import urlp...
none
1
2.175043
2
computer-basic/practice/rock-scissors-paper.py
dearjsmc4/basic
0
6623665
# 절차지향적 프로그래밍 # 1. 상대방으로부터 문자열을 받기. import random def get_player_choice(): """ get_player_choice() --> string 반환 반환값 : "가위" or "바위" or "보" """ li=("가위","바위","보") mine=input("선택해라 휴먼 : ") while mine not in li: mine=input("똑바로 선택해라 휴먼 : ") return mine def get_computer_choice()...
# 절차지향적 프로그래밍 # 1. 상대방으로부터 문자열을 받기. import random def get_player_choice(): """ get_player_choice() --> string 반환 반환값 : "가위" or "바위" or "보" """ li=("가위","바위","보") mine=input("선택해라 휴먼 : ") while mine not in li: mine=input("똑바로 선택해라 휴먼 : ") return mine def get_computer_choice()...
ko
0.92625
# 절차지향적 프로그래밍 # 1. 상대방으로부터 문자열을 받기. get_player_choice() --> string 반환 반환값 : "가위" or "바위" or "보" get_computer_choice() --> string 반환 반환값: "가위" | "바위" | "보" who_wins(player, com) --> string 반환값 : 플레이어가 이기면 문자로 "player" 컴퓨터가 이기면 문자로 "computer" 비기면 None who_wins(player, com) --> string ...
3.968307
4
backend/account_handlers/withdraw.py
rhedgeco/dank_bank
0
6623666
<reponame>rhedgeco/dank_bank<filename>backend/account_handlers/withdraw.py import falcon from ..authenticator import get_id_from_token from ..param_handler import validate_params from ..database_manager import withdraw_money, get_account_by_id class Withdraw: @staticmethod def on_post(req, resp): if...
import falcon from ..authenticator import get_id_from_token from ..param_handler import validate_params from ..database_manager import withdraw_money, get_account_by_id class Withdraw: @staticmethod def on_post(req, resp): if not validate_params(req.params, 'authToken', 'account_id', 'amount'): ...
en
0.914786
# if account is not owned by current user, fail # if account balance is not sufficient, fail
2.515187
3
coordinate_tools.py
dmholtz/RoboticArm
1
6623667
<filename>coordinate_tools.py import numpy as np import math class Transformation(): """Handles cartesian coordinate transformations. """ def __init__(self, rotation_matrix, translation_vector, \ calc_inverse = True): """Initializes a coordinate transformation object. Accepts a r...
<filename>coordinate_tools.py import numpy as np import math class Transformation(): """Handles cartesian coordinate transformations. """ def __init__(self, rotation_matrix, translation_vector, \ calc_inverse = True): """Initializes a coordinate transformation object. Accepts a r...
en
0.71495
Handles cartesian coordinate transformations. Initializes a coordinate transformation object. Accepts a rotation matrix and a translation vector, by which a linear coordinate transformation is defined. Calculates the the inverse transformation function and stores it as a CoordinateTransformatio...
3.645601
4
snowddl/resolver/tag.py
littleK0i/SnowDDL
21
6623668
<gh_stars>10-100 from snowddl.blueprint import TagBlueprint, ObjectType, SchemaObjectIdent from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult class TagResolver(AbstractSchemaObjectResolver): skip_on_empty_blueprints = True def get_object_type(self) -> ObjectTy...
from snowddl.blueprint import TagBlueprint, ObjectType, SchemaObjectIdent from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult class TagResolver(AbstractSchemaObjectResolver): skip_on_empty_blueprints = True def get_object_type(self) -> ObjectType: retur...
en
0.925693
# Tag was applied before # Tag was applied with the same value # Apply tag # Remove remaining tag references which no longer exist in blueprint # TODO: discover a better way to get tag references in real time # Currently it is not clear how to get all tag references properly
2.261566
2
exts/managing.py
erick-dsnk/uncle-dunks-discord-bot
0
6623669
import discord from discord.ext import commands from discord.ext.commands import Bot, Cog, Context class Manager(Cog): def __init__(self, bot: Bot) -> None: self.bot = bot @commands.has_permissions(kick_members=True) @commands.command() async def announce(self, ctx: Context, channel: dis...
import discord from discord.ext import commands from discord.ext.commands import Bot, Cog, Context class Manager(Cog): def __init__(self, bot: Bot) -> None: self.bot = bot @commands.has_permissions(kick_members=True) @commands.command() async def announce(self, ctx: Context, channel: dis...
en
0.858948
Make an announcement with a fancy embed containing your important message. #{ctx.author.discriminator}.") Does the same thing as `announce` but also tags `@everyone`. #{ctx.author.discriminator}.") Does the same thing as `announce` but also tags `@here` #{ctx.author.discriminator}.")
2.872819
3
torchaudio_augmentations/augmentations/reverb.py
wesbz/torchaudio-augmentations
112
6623670
import augment import torch class Reverb(torch.nn.Module): def __init__( self, sample_rate, reverberance_min=0, reverberance_max=100, dumping_factor_min=0, dumping_factor_max=100, room_size_min=0, room_size_max=100, ): super().__init__() ...
import augment import torch class Reverb(torch.nn.Module): def __init__( self, sample_rate, reverberance_min=0, reverberance_max=100, dumping_factor_min=0, dumping_factor_max=100, room_size_min=0, room_size_max=100, ): super().__init__() ...
none
1
2.657631
3
web/server.py
piyush82/icclab-rcb
2
6623671
############################################################ #@author: <NAME> (<EMAIL>) #@version: 0.1 #@summary: Module implementing RCB Restful Web Interface # #@requires: bottle ############################################################ from bottle import get, post, request, route, run, response import ConfigPars...
############################################################ #@author: <NAME> (<EMAIL>) #@version: 0.1 #@summary: Module implementing RCB Restful Web Interface # #@requires: bottle ############################################################ from bottle import get, post, request, route, run, response import ConfigPars...
en
0.334589
############################################################ #@author: <NAME> (<EMAIL>) #@version: 0.1 #@summary: Module implementing RCB Restful Web Interface # #@requires: bottle ############################################################ #list of database tables, this list is used to do DB sanity check whenever nee...
2.725199
3
AppDB/appscale/datastore/cassandra_env/entity_id_allocator.py
HafeezRai/appscale
1
6623672
import sys import uuid from appscale.common.unpackaged import APPSCALE_PYTHON_APPSERVER from cassandra.query import ( ConsistencyLevel, SimpleStatement ) from tornado import gen from appscale.datastore.cassandra_env.retry_policies import NO_RETRIES from appscale.datastore.cassandra_env.tornado_cassandra import To...
import sys import uuid from appscale.common.unpackaged import APPSCALE_PYTHON_APPSERVER from cassandra.query import ( ConsistencyLevel, SimpleStatement ) from tornado import gen from appscale.datastore.cassandra_env.retry_policies import NO_RETRIES from appscale.datastore.cassandra_env.tornado_cassandra import To...
en
0.844715
# The number of scattered IDs the datastore should reserve at a time. Indicates that a block of IDs could not be reserved. Keeps track of reserved entity IDs for a project. Creates a new EntityIDAllocator object. Args: session: A cassandra-drivers session object. project: A string specifying a project ...
2.015592
2
version.py
Keneral/aeclang
0
6623673
<gh_stars>0 major = '3' minor = '8' patch = '256229'
major = '3' minor = '8' patch = '256229'
none
1
1.151842
1
config.py
ethanaggor/twitter-clone
0
6623674
<gh_stars>0 import os from pathlib import Path BASE_DIR = Path(__file__).parent class DevConfig(object): # It's very unfortunate that you can't enable development-mode without setting Env variables. SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format( BASE_DIR.joinpath('blah.sqlite3') ) S...
import os from pathlib import Path BASE_DIR = Path(__file__).parent class DevConfig(object): # It's very unfortunate that you can't enable development-mode without setting Env variables. SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format( BASE_DIR.joinpath('blah.sqlite3') ) SQLALCHEMY_TR...
en
0.920643
# It's very unfortunate that you can't enable development-mode without setting Env variables.
1.949612
2
python/yacht/yacht.py
sci-c0/exercism-learning
0
6623675
<filename>python/yacht/yacht.py<gh_stars>0 from collections import Counter from typing import List, Callable _NUM_CATEGORIES = 12 # Score categories. (YACHT, ONES, TWOS, THREES, FOURS, FIVES, SIXES, FULL_HOUSE, FOUR_OF_A_KIND, LITTLE_STRAIGHT, BIG_STRAIGHT, CHOICE) = range(_NUM_CATEGORIES) def _yacht_score(dice: ...
<filename>python/yacht/yacht.py<gh_stars>0 from collections import Counter from typing import List, Callable _NUM_CATEGORIES = 12 # Score categories. (YACHT, ONES, TWOS, THREES, FOURS, FIVES, SIXES, FULL_HOUSE, FOUR_OF_A_KIND, LITTLE_STRAIGHT, BIG_STRAIGHT, CHOICE) = range(_NUM_CATEGORIES) def _yacht_score(dice: ...
en
0.348089
# Score categories.
3.05971
3
awx/main/models/ha.py
doziya/ansible
1
6623676
<gh_stars>1-10 # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.utils.timezone import now, timed...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.utils.timezone import now, timedelta from solo...
en
0.969788
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. A model representing an AWX instance running against this database. # NOTE: TODO: Likely to repurpose this once standalone ramparts are a thing A model representing a Queue/Group of AWX Instances. A model representing the relationship between a unified job and ...
1.871209
2
jsk_recognition/imagesift/sample/sift_keypoints.py
VT-ASIM-LAB/autoware.ai
0
6623677
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 from scipy.misc import lena import imagesift def main(): img = lena() frames, desc = imagesift.get_sift_keypoints(img) out = imagesift.draw_sift_frames(img, frames) cv2.imshow('sift image', out) cv2.waitKey(0) if __name__ == '__main__...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 from scipy.misc import lena import imagesift def main(): img = lena() frames, desc = imagesift.get_sift_keypoints(img) out = imagesift.draw_sift_frames(img, frames) cv2.imshow('sift image', out) cv2.waitKey(0) if __name__ == '__main__...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.961492
3
backend/Ehaat/details/migrations/0001_initial.py
shuttlesworthNEO/HackIIITD-fSociety
0
6623678
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-25 19:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-25 19:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
en
0.769472
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-25 19:31
1.589288
2
08slice.py
Ulyssesss/Learn-Python
1
6623679
<reponame>Ulyssesss/Learn-Python l = [0, 1, 2, 3, 4, 5] print(l[0:3]) print(l[:3]) print(l[2:4]) print(l[-3:-1]) print(l[-3:]) ll = list(range(100)) print(ll[::5]) print((0, 1, 2, 3, 4, 5)[:3]) print('abc'[:2])
l = [0, 1, 2, 3, 4, 5] print(l[0:3]) print(l[:3]) print(l[2:4]) print(l[-3:-1]) print(l[-3:]) ll = list(range(100)) print(ll[::5]) print((0, 1, 2, 3, 4, 5)[:3]) print('abc'[:2])
none
1
3.681755
4
scripts/stt_wit.py
ray-hrst/stt
1
6623680
<reponame>ray-hrst/stt #!/usr/bin/env python # -*- coding: utf-8 -*- """Speech to text using wit.ai Speech-to-Text API. Example usage: python stt_wit.py /path/to/audio/sample.wav Notes: - Default sampling rate is 16 kHz - Language must be predefined in the user-interface - There isn't a lot of detail regardin...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Speech to text using wit.ai Speech-to-Text API. Example usage: python stt_wit.py /path/to/audio/sample.wav Notes: - Default sampling rate is 16 kHz - Language must be predefined in the user-interface - There isn't a lot of detail regarding the desired audio for...
en
0.618436
#!/usr/bin/env python # -*- coding: utf-8 -*- Speech to text using wit.ai Speech-to-Text API. Example usage: python stt_wit.py /path/to/audio/sample.wav Notes: - Default sampling rate is 16 kHz - Language must be predefined in the user-interface - There isn't a lot of detail regarding the desired audio format,...
3.451543
3
testcases/OpTestKdumpLparSmt.py
rashijhawar/op-test
23
6623681
<gh_stars>10-100 #!/usr/bin/env python2 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/testcases/OpTestKdumpLparSmt.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed unde...
#!/usr/bin/env python2 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/testcases/OpTestKdumpLparSmt.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache Lice...
en
0.743033
#!/usr/bin/env python2 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/testcases/OpTestKdumpLparSmt.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache Lice...
1.914017
2
klab/cluster/python_script_template.py
Kortemme-Lab/klab
2
6623682
import sys from time import strftime import socket import os import platform import subprocess import tempfile import shutil import glob import re import shlex import traceback # Utility functions class ProcessOutput(object): def __init__(self, stdout, stderr, errorcode): self.stdout = stdout se...
import sys from time import strftime import socket import os import platform import subprocess import tempfile import shutil import glob import re import shlex import traceback # Utility functions class ProcessOutput(object): def __init__(self, stdout, stderr, errorcode): self.stdout = stdout se...
en
0.795586
# Utility functions # 0 is stdout, 1 is stderr # 0 is stdout, 1 is stderr Prints the stdout and stderr output. # Job/task parameters # this can be used to index Python arrays (0-indexed) rather than task_id (based on 1-indexing) # failed jobs should set errorcode # Markup opener # Standard task properties - start time,...
2.248761
2
ElectionTwitterSentiment-IssueResolving.py
ridhitbhura/NLP-Twitter
0
6623683
#!/usr/bin/env python # coding: utf-8 # # NLP of Prime Minister Narendra Modi's Tweets during COVID-19 # #### By <NAME> # In this project, I gathered a dataset from https://www.kaggle.com/saurabhshahane/twitter-sentiment-dataset and use the pretrained data to train a set of ~3500 tweets from Prime Minister Narendra ...
#!/usr/bin/env python # coding: utf-8 # # NLP of Prime Minister Narendra Modi's Tweets during COVID-19 # #### By <NAME> # In this project, I gathered a dataset from https://www.kaggle.com/saurabhshahane/twitter-sentiment-dataset and use the pretrained data to train a set of ~3500 tweets from Prime Minister Narendra ...
en
0.684227
#!/usr/bin/env python # coding: utf-8 # # NLP of Prime Minister Narendra Modi's Tweets during COVID-19 # #### By <NAME> # In this project, I gathered a dataset from https://www.kaggle.com/saurabhshahane/twitter-sentiment-dataset and use the pretrained data to train a set of ~3500 tweets from Prime Minister Narendra Mod...
2.953359
3
recipe/middlewares.py
gotoeveryone/myrecipe
0
6623684
<gh_stars>0 """ カスタムミドルウェア """ import json from django.conf import settings from django.utils.deprecation import MiddlewareMixin from django.utils.functional import SimpleLazyObject from recipe.core.models import User class WebApiAuthenticationMiddleware(MiddlewareMixin): """ API認証ミドルウェア """ def proc...
""" カスタムミドルウェア """ import json from django.conf import settings from django.utils.deprecation import MiddlewareMixin from django.utils.functional import SimpleLazyObject from recipe.core.models import User class WebApiAuthenticationMiddleware(MiddlewareMixin): """ API認証ミドルウェア """ def process_request(...
ja
0.999416
カスタムミドルウェア API認証ミドルウェア リクエスト時の処理 @param request セッションからログインユーザを取得する @param request
2.363202
2
src/operators/test_identity.py
ClarkChiu/learn-python-tw
3
6623685
<reponame>ClarkChiu/learn-python-tw """恆等運算子 @詳見: https://www.w3schools.com/python/python_operators.asp 恆等運算子用途為比較物件,不僅是比較物件的內容,而是會更進一步比較到物件的記憶體位址 """ def test_identity_operators(): """恆等運算子""" # 讓我們使用以下的串列來說明恆等運算子 first_fruits_list = ["apple", "banana"] second_fruits_list = ["apple", "banana"] ...
"""恆等運算子 @詳見: https://www.w3schools.com/python/python_operators.asp 恆等運算子用途為比較物件,不僅是比較物件的內容,而是會更進一步比較到物件的記憶體位址 """ def test_identity_operators(): """恆等運算子""" # 讓我們使用以下的串列來說明恆等運算子 first_fruits_list = ["apple", "banana"] second_fruits_list = ["apple", "banana"] third_fruits_list = first_fruits_li...
zh
0.973701
恆等運算子 @詳見: https://www.w3schools.com/python/python_operators.asp 恆等運算子用途為比較物件,不僅是比較物件的內容,而是會更進一步比較到物件的記憶體位址 恆等運算子 # 讓我們使用以下的串列來說明恆等運算子 # 是(is) # 比對兩個變數,若這兩個變數是相同的物件,則回傳真值 # 範例: # first_fruits_list 和 third_fruits_list 是相同的物件 # 不是(is not) # 比對兩個變數,若這兩個變數不是相同的物件,則回傳真值 # 範例: # 雖然 first_fruits_list 和 second_fruits_list 有著...
4.453651
4
Create_PPI_preview.py
diogo1790team/inphinity_DM
1
6623686
<reponame>diogo1790team/inphinity_DM # -*- coding: utf-8 -*- """ Created on Fri May 4 08:27:54 2018 @author: Diogo """ from objects_new.Couples_new import * from objects_new.Proteins_new import * from objects_new.Protein_dom_new import * from objects_new.DDI_interactions_DB_new import * from objects_new.PPI_preview_n...
# -*- coding: utf-8 -*- """ Created on Fri May 4 08:27:54 2018 @author: Diogo """ from objects_new.Couples_new import * from objects_new.Proteins_new import * from objects_new.Protein_dom_new import * from objects_new.DDI_interactions_DB_new import * from objects_new.PPI_preview_new import * import time listasd = ...
en
0.596666
# -*- coding: utf-8 -*- Created on Fri May 4 08:27:54 2018 @author: Diogo #qty_val = PPI_preview.get_number_ppi_score_by_bact_phage_prots(1977507, 27085575) #calcule the DDI score iPFAM, 3DID and ME have the maximum score ->9 #Get all couples from NCBI and Phages DB #Get all couples from Greg #id_couple = list_couples...
1.95412
2
chiki_jinja.py
endsh/chiki-jinja
0
6623687
# coding: utf-8 import re import json import traceback from datetime import datetime from flask import current_app, get_flashed_messages from jinja2 import Markup from xml.sax.saxutils import escape from chiki_base import time2best as _time2best, is_ajax, url_with_user, markup __all__ = [ 'markup', 'markupper', 'f...
# coding: utf-8 import re import json import traceback from datetime import datetime from flask import current_app, get_flashed_messages from jinja2 import Markup from xml.sax.saxutils import escape from chiki_base import time2best as _time2best, is_ajax, url_with_user, markup __all__ = [ 'markup', 'markupper', 'f...
en
0.833554
# coding: utf-8
2.234648
2
setup.py
MarkCiampa/HippocampusSegmentationMRI
16
6623688
<reponame>MarkCiampa/HippocampusSegmentationMRI<filename>setup.py import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open('requirements.txt') as f: required = f.read().splitlines() setuptools.setup( name="hippo-vnet", version="0.0.1", author="<NAME>", autho...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() with open('requirements.txt') as f: required = f.read().splitlines() setuptools.setup( name="hippo-vnet", version="0.0.1", author="<NAME>", author_email="<EMAIL>", description="Hippocampus Segmentation from ...
none
1
1.547833
2
cs15211/ValidParenthesisString.py
JulyKikuAkita/PythonPrac
1
6623689
<reponame>JulyKikuAkita/PythonPrac __source__ = 'https://leetcode.com/problems/valid-parenthesis-string/description/' # Time: O() # Space: O() # # Description: Leetcode # 678. Valid Parenthesis String # # Given a string containing only three types of characters: '(', ')' and '*', # write a function to check whether th...
__source__ = 'https://leetcode.com/problems/valid-parenthesis-string/description/' # Time: O() # Space: O() # # Description: Leetcode # 678. Valid Parenthesis String # # Given a string containing only three types of characters: '(', ')' and '*', # write a function to check whether this string is valid. # We define the...
en
0.516136
# Time: O() # Space: O() # # Description: Leetcode # 678. Valid Parenthesis String # # Given a string containing only three types of characters: '(', ')' and '*', # write a function to check whether this string is valid. # We define the validity of a string by these rules: # # Any left parenthesis '(' must have a corr...
3.703618
4
tests/persistence/person_dao_spark_test.py
pydev-bootcamp/python-etl
0
6623690
""" Unit tests for PersonDao """ from datetime import datetime import os from os.path import dirname, abspath, join from pytest import raises from tempfile import mkstemp from typing import List, Optional, TextIO from textwrap import dedent from manage_accounts.model.person import Person from manage_accounts.persisten...
""" Unit tests for PersonDao """ from datetime import datetime import os from os.path import dirname, abspath, join from pytest import raises from tempfile import mkstemp from typing import List, Optional, TextIO from textwrap import dedent from manage_accounts.model.person import Person from manage_accounts.persisten...
en
0.653026
Unit tests for PersonDao # from pprint import pprint # pretty-print Python data structures # create temp file # else file was closed in init_test_data() # remove temp file # dao.df.printSchema() # next(iter(...)) performs one iteration of the Iterable argument # find() is s generator function, so it won't be execut...
2.384758
2
open_alchemy/schemas/validation/helpers/__init__.py
rgreinho/OpenAlchemy
0
6623691
<filename>open_alchemy/schemas/validation/helpers/__init__.py """Helpers for validation.""" from . import properties from . import value
<filename>open_alchemy/schemas/validation/helpers/__init__.py """Helpers for validation.""" from . import properties from . import value
en
0.603841
Helpers for validation.
1.280541
1
project/tests/test_news_filter.py
anton-svechnikau/feedya
0
6623692
import news_filter from tests.factories import NewsItemEntityFactory from exceptions import NewsAlreadyExists class TestNewsFilter: def test_mark_late_news__new_entity__fresh_news(self, mocker): entity = NewsItemEntityFactory() mock = mocker.patch('news_filter.db.create_news') mock.ret...
import news_filter from tests.factories import NewsItemEntityFactory from exceptions import NewsAlreadyExists class TestNewsFilter: def test_mark_late_news__new_entity__fresh_news(self, mocker): entity = NewsItemEntityFactory() mock = mocker.patch('news_filter.db.create_news') mock.ret...
none
1
2.381349
2
src/vlcars/vlcars_main.py
dcarrillox/VLCars
0
6623693
<reponame>dcarrillox/VLCars<gh_stars>0 import logging import sys, os, glob import argparse from platformdirs import * import pandas as pd #from vlcars import __version__ from vlcars.local_db import * from vlcars.query_online import * from vlcars.app import * __author__ = "dcarrillox" __copyright__ = "dcarrillox...
import logging import sys, os, glob import argparse from platformdirs import * import pandas as pd #from vlcars import __version__ from vlcars.local_db import * from vlcars.query_online import * from vlcars.app import * __author__ = "dcarrillox" __copyright__ = "dcarrillox" __license__ = "MIT" _logger = loggin...
en
0.414208
#from vlcars import __version__ # init local_db # ----------------------------------- # Check arguments and run accordingly # --heroku # parse tabular database to DataFrame and run app. Used by branch "heroku" to run app on Heroku. #args.heroku = True # --sql_to_tab # parses current SQL database to tsv in "data/yy-mm-d...
2.756461
3
movefile_restart/__init__.py
hammy3502/python-movefile-restart
0
6623694
<reponame>hammy3502/python-movefile-restart from .main import DeleteFile, MoveFile, RenameFile, GetFileOperations, PrintFileOperations, RemoveFileOperation, CheckPermissions __version__ = "1.0.1"
from .main import DeleteFile, MoveFile, RenameFile, GetFileOperations, PrintFileOperations, RemoveFileOperation, CheckPermissions __version__ = "1.0.1"
none
1
1.170268
1
noobWS/_server.py
lancechua/noobWS
0
6623695
<filename>noobWS/_server.py """NoobServer Module""" import asyncio import logging from typing import Dict, List import websockets import zmq from zmq.asyncio import Context from .constants import Keyword class NoobServer: """ NoobServer class Has the following channels: * Websockets * Sock...
<filename>noobWS/_server.py """NoobServer Module""" import asyncio import logging from typing import Dict, List import websockets import zmq from zmq.asyncio import Context from .constants import Keyword class NoobServer: """ NoobServer class Has the following channels: * Websockets * Sock...
en
0.583214
NoobServer Module NoobServer class Has the following channels: * Websockets * Socket(s) connected to external URI(s) * If single socket, socket name = `self.name` * If multi socket, socket name = key in `uri` param * Command listener (zmq.PULL by default) * listens to incomi...
2.734912
3
test/logger.py
mokbat/callerid_test
0
6623696
""" ########################################################## # logger - A class module to assist you in your logging. # # # # This is a stand alone logging function file. # # It gives you an ease creating logging functionality # # for your test cases...
""" ########################################################## # logger - A class module to assist you in your logging. # # # # This is a stand alone logging function file. # # It gives you an ease creating logging functionality # # for your test cases...
en
0.540115
########################################################## # logger - A class module to assist you in your logging. # # # # This is a stand alone logging function file. # # It gives you an ease creating logging functionality # # for your test cases. Th...
3.389378
3
converter_gui.py
ShuksanGeomatics/Salish_Sea_Coordinate_Converter
0
6623697
<reponame>ShuksanGeomatics/Salish_Sea_Coordinate_Converter #!/usr/bin/python3 '''This script is a graphic user interface using for generating KML files and CSV files.''' import sys import traceback try: import convert import tkinter as tk from tkinter import ttk def sscon...
#!/usr/bin/python3 '''This script is a graphic user interface using for generating KML files and CSV files.''' import sys import traceback try: import convert import tkinter as tk from tkinter import ttk def ssconvert(): in_crs = incrs.get() out_crs = ou...
en
0.340044
#!/usr/bin/python3 This script is a graphic user interface using for generating KML files and CSV files. #out_label = Label(root, text= str(conversion.out_x) +', ' +str( conversion.out_y)) #out_latel.pack() # Creating tkinter window # label # label # label # label # Combobox creation # Combobox creation # Adding combob...
3.027438
3
burgeon-server/burgeon/api/tracks/delete_track_api.py
danielvinson/Burgeon
1
6623698
import logging import json from flask import request, make_response, jsonify from flask.views import MethodView from flask_login import current_user from burgeon import db from burgeon.models import Track log = logging.getLogger('burgeon.track.delete_track_api') class DeleteTrackAPI(MethodView): """ Delete ...
import logging import json from flask import request, make_response, jsonify from flask.views import MethodView from flask_login import current_user from burgeon import db from burgeon.models import Track log = logging.getLogger('burgeon.track.delete_track_api') class DeleteTrackAPI(MethodView): """ Delete ...
en
0.989964
Delete Track
2.264223
2
scripts/tSNEW2V_Sum.py
nik-sm/neural-topic-models-music
0
6623699
<reponame>nik-sm/neural-topic-models-music import matplotlib.pyplot as plt from sklearn.manifold import TSNE import numpy as np sumFeatures = np.load("../data/nik/word2VecSumFeatures.npy") X_embedded = TSNE(n_components=2).fit_transform(sumFeatures) np.save("../results/tSNE_w2v_sum.npy")
import matplotlib.pyplot as plt from sklearn.manifold import TSNE import numpy as np sumFeatures = np.load("../data/nik/word2VecSumFeatures.npy") X_embedded = TSNE(n_components=2).fit_transform(sumFeatures) np.save("../results/tSNE_w2v_sum.npy")
none
1
2.551311
3
python/302.smallest-rectangle-enclosing-black-pixels.py
Zhenye-Na/leetcode
10
6623700
<reponame>Zhenye-Na/leetcode<gh_stars>1-10 # [302] Smallest Rectangle Enclosing Black Pixels # Description # An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. # The black pixels are connected, i.e., there is only one black region. # Pixels are connected horizontally and verti...
# [302] Smallest Rectangle Enclosing Black Pixels # Description # An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. # The black pixels are connected, i.e., there is only one black region. # Pixels are connected horizontally and vertically. # Given the location (x, y) of one ...
en
0.776718
# [302] Smallest Rectangle Enclosing Black Pixels # Description # An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. # The black pixels are connected, i.e., there is only one black region. # Pixels are connected horizontally and vertically. # Given the location (x, y) of one of t...
3.896281
4
app.py
Yuchees/esf_maps_template
0
6623701
<reponame>Yuchees/esf_maps_template #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Template of the interactive ESF map within 3D molecular viewer Author: <NAME> """ import pandas as pd import dash import dash_html_components as html import dash_core_components as dcc from utils import th4_plot, structure_viewer f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Template of the interactive ESF map within 3D molecular viewer Author: <NAME> """ import pandas as pd import dash import dash_html_components as html import dash_core_components as dcc from utils import th4_plot, structure_viewer from config import CONFIG # Set up w...
en
0.640658
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Template of the interactive ESF map within 3D molecular viewer Author: <NAME> # Set up web server # Load dataframe # Application object and HTML components # Dash title and icon # Dash graph and 3D molecule viewer # Dash axis, colour bar and range selection controller # Da...
2.231457
2
第11章/program/baidu/spiders/example.py
kingname/SourceCodeOfBook
274
6623702
# -*- coding: utf-8 -*- import scrapy class ExampleSpider(scrapy.Spider): name = "example" allowed_domains = ["baidu.com"] start_urls = ['http://baidu.com/'] def parse(self, response): # title = response.xpath('//title/text()').extract() # search_button_text = response.xpath('//input[...
# -*- coding: utf-8 -*- import scrapy class ExampleSpider(scrapy.Spider): name = "example" allowed_domains = ["baidu.com"] start_urls = ['http://baidu.com/'] def parse(self, response): # title = response.xpath('//title/text()').extract() # search_button_text = response.xpath('//input[...
en
0.352694
# -*- coding: utf-8 -*- # title = response.xpath('//title/text()').extract() # search_button_text = response.xpath('//input[@class="bg s_btn"]/@value').extract() # print(title) # print(search_button_text)
3.07067
3
src/resdk/tables/methylation.py
robertcv/resolwe-bio-py
4
6623703
""".. Ignore pydocstyle D400. ================= MethylationTables ================= .. autoclass:: MethylationTables :members: .. automethod:: __init__ """ import os from functools import lru_cache from typing import Callable, List, Optional import pandas as pd from resdk.resources import Collection from...
""".. Ignore pydocstyle D400. ================= MethylationTables ================= .. autoclass:: MethylationTables :members: .. automethod:: __init__ """ import os from functools import lru_cache from typing import Callable, List, Optional import pandas as pd from resdk.resources import Collection from...
en
0.64638
.. Ignore pydocstyle D400. ================= MethylationTables ================= .. autoclass:: MethylationTables :members: .. automethod:: __init__ A helper class to fetch collection's methylation and meta data. This class enables fetching given collection's data and returning it as tables which ha...
2.430606
2
tests/test_utils/test_memory.py
Youth-Got/mmdetection
1
6623704
import numpy as np import pytest import torch from mmdet.utils import AvoidOOM from mmdet.utils.memory import cast_tensor_type def test_avoidoom(): tensor = torch.from_numpy(np.random.random((20, 20))) if torch.cuda.is_available(): tensor = tensor.cuda() # get default result default_r...
import numpy as np import pytest import torch from mmdet.utils import AvoidOOM from mmdet.utils.memory import cast_tensor_type def test_avoidoom(): tensor = torch.from_numpy(np.random.random((20, 20))) if torch.cuda.is_available(): tensor = tensor.cuda() # get default result default_r...
en
0.794108
# get default result # when not occurred OOM error # calculate with fp16 and convert back to source type # calculate on cpu and convert back to source device # do not calculate on cpu and the outputs will be same as input # input is a float # convert Tensor to fp16 and re-convert to fp32 # input is a list # input is a ...
1.950594
2
obo/exceptions.py
biosustain/obo
1
6623705
<gh_stars>1-10 class OBOException(object): pass class OBOTagCardinalityException(OBOException): def __init__(self, stanza, tag, cardinality=(0, 1)): pass class UnknownTermSubset(OBOException): """ https://oboformat.googlecode.com/svn/trunk/doc/GO.format.obo-1_2.html#S.2.2 The value of...
class OBOException(object): pass class OBOTagCardinalityException(OBOException): def __init__(self, stanza, tag, cardinality=(0, 1)): pass class UnknownTermSubset(OBOException): """ https://oboformat.googlecode.com/svn/trunk/doc/GO.format.obo-1_2.html#S.2.2 The value of this tag must be...
en
0.671261
https://oboformat.googlecode.com/svn/trunk/doc/GO.format.obo-1_2.html#S.2.2 The value of this tag must be a subset name as defined in a subsetdef tag in the file header. If the value of this tag is not mentioned in a subsetdef tag, a parse error will be generated. A term may belong to any number of subsets.
2.570663
3
brain_brew/configuration/build_config/parts_builder.py
aplaice/brain-brew
0
6623706
from dataclasses import dataclass from typing import Dict, Type, List, Set from brain_brew.build_tasks.crowd_anki.headers_from_crowdanki import HeadersFromCrowdAnki from brain_brew.build_tasks.crowd_anki.media_group_from_crowd_anki import MediaGroupFromCrowdAnki from brain_brew.build_tasks.crowd_anki.note_models_from_...
from dataclasses import dataclass from typing import Dict, Type, List, Set from brain_brew.build_tasks.crowd_anki.headers_from_crowdanki import HeadersFromCrowdAnki from brain_brew.build_tasks.crowd_anki.media_group_from_crowd_anki import MediaGroupFromCrowdAnki from brain_brew.build_tasks.crowd_anki.note_models_from_...
none
1
1.957746
2
chapter04/base_orm_operate/book/models.py
Tomtao626/django
0
6623707
from django.db import models # Create your models here. class Book(models.Model): """ 图书 """ name = models.CharField(max_length=100, null=False) author = models.CharField(max_length=100, null=False) price = models.FloatField(default=0) def __str__(self): # <Book:(name,author,price...
from django.db import models # Create your models here. class Book(models.Model): """ 图书 """ name = models.CharField(max_length=100, null=False) author = models.CharField(max_length=100, null=False) price = models.FloatField(default=0) def __str__(self): # <Book:(name,author,price...
en
0.75541
# Create your models here. 图书 # <Book:(name,author,price)>
2.992257
3
domains.py
Yepoleb/gv.at
1
6623708
import csv import jinja2 with open("gv.at.csv") as csvfile: reader = csv.reader(csvfile) next(reader) rows = list(reader) domains = set(r[2] for r in rows) filtdomains = set() for dom in domains: if '@' in dom: continue if dom.startswith("*") and dom[2:] in domains: continue ...
import csv import jinja2 with open("gv.at.csv") as csvfile: reader = csv.reader(csvfile) next(reader) rows = list(reader) domains = set(r[2] for r in rows) filtdomains = set() for dom in domains: if '@' in dom: continue if dom.startswith("*") and dom[2:] in domains: continue ...
none
1
3.107192
3
bin/params/con.py
chapochn/ORN-LN_circuit
1
6623709
<filename>bin/params/con.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 30 14:24:44 2017 @author: <NAME> """ file_L = 'data/Berck_2016/elife-14859-supp1-v2_no_blanks.xlsx' file_R = 'data/Berck_2016/elife-14859-supp2-v2_no_blanks.xlsx' # this is some information from the excel sheet # not su...
<filename>bin/params/con.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 30 14:24:44 2017 @author: <NAME> """ file_L = 'data/Berck_2016/elife-14859-supp1-v2_no_blanks.xlsx' file_R = 'data/Berck_2016/elife-14859-supp2-v2_no_blanks.xlsx' # this is some information from the excel sheet # not su...
en
0.856579
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Thu Nov 30 14:24:44 2017 @author: <NAME> # this is some information from the excel sheet # not sure if it is meaningful to put it here, or somewhere else # or to read out from some parameter file. Let's leave it here for the moment # A being all
2.425056
2
swagger_client/models/market_filter.py
akxlr/bf-stream-py
0
6623710
<gh_stars>0 # coding: utf-8 """ Betfair: Exchange Streaming API API to receive streamed updates. This is an ssl socket connection of CRLF delimited json messages (see RequestMessage & ResponseMessage) OpenAPI spec version: 1.0.1423 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swa...
# coding: utf-8 """ Betfair: Exchange Streaming API API to receive streamed updates. This is an ssl socket connection of CRLF delimited json messages (see RequestMessage & ResponseMessage) OpenAPI spec version: 1.0.1423 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen...
en
0.733245
# coding: utf-8 Betfair: Exchange Streaming API API to receive streamed updates. This is an ssl socket connection of CRLF delimited json messages (see RequestMessage & ResponseMessage) OpenAPI spec version: 1.0.1423 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git ...
1.377378
1
week_3/string/fstring.py
mikolevy/python-zp
0
6623711
python_age = 30 # info = "Python ma już prawie: " + str(python_age) + " lat!" # info = f"Python ma już prawie {python_age} lat!" # calculation = f"Wynik działania 3 x 6 to {3 * 6}" # name = "Mikołaj" # hello = f"Nazywam się {name}"
python_age = 30 # info = "Python ma już prawie: " + str(python_age) + " lat!" # info = f"Python ma już prawie {python_age} lat!" # calculation = f"Wynik działania 3 x 6 to {3 * 6}" # name = "Mikołaj" # hello = f"Nazywam się {name}"
pl
0.767946
# info = "Python ma już prawie: " + str(python_age) + " lat!" # info = f"Python ma już prawie {python_age} lat!" # calculation = f"Wynik działania 3 x 6 to {3 * 6}" # name = "Mikołaj" # hello = f"Nazywam się {name}"
2.993298
3
social/urls.py
mashiyathussain2/SocialMediaApp
1
6623712
from django.urls import path from social import views urlpatterns = [ path('home/',views.Home.as_view()), path('post/',views.Post.as_view()), path('post/<int:pk>/like',views.PostLike.as_view()), path('post/<int:pk>/comment',views.PostComment.as_view()), path('', views.Wall.as_view()) ]
from django.urls import path from social import views urlpatterns = [ path('home/',views.Home.as_view()), path('post/',views.Post.as_view()), path('post/<int:pk>/like',views.PostLike.as_view()), path('post/<int:pk>/comment',views.PostComment.as_view()), path('', views.Wall.as_view()) ]
none
1
1.857475
2
pyppmc/notification.py
aleofreitas/pyppmc
0
6623713
# -*- coding: utf-8 -*- # Copyright 2018 <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 agre...
# -*- coding: utf-8 -*- # Copyright 2018 <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 agre...
en
0.633535
# -*- coding: utf-8 -*- # Copyright 2018 <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 agre...
2.377278
2
nlp_demo/seomap/TextTool.py
maliozer/cs224n
0
6623714
import sys assert sys.version_info[0]==3 assert sys.version_info[1] >= 5 from gensim.models import KeyedVectors from gensim.test.utils import datapath import pprint import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = [10, 5] import numpy as np import random import scipy as sp from sklearn.decomposition i...
import sys assert sys.version_info[0]==3 assert sys.version_info[1] >= 5 from gensim.models import KeyedVectors from gensim.test.utils import datapath import pprint import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = [10, 5] import numpy as np import random import scipy as sp from sklearn.decomposition i...
none
1
2.422242
2
reduce.py
axipher/palette-reducer-inputs
1
6623715
# dependencies import matplotlib.pyplot as pyplot from PIL import Image import os import time import math import numpy import sklearn.cluster import sklearn.preprocessing import sys, getopt import ntpath def main(argv): tic = time.perf_counter() # Waifu2x-caffe available from: https:/...
# dependencies import matplotlib.pyplot as pyplot from PIL import Image import os import time import math import numpy import sklearn.cluster import sklearn.preprocessing import sys, getopt import ntpath def main(argv): tic = time.perf_counter() # Waifu2x-caffe available from: https:/...
en
0.741393
# dependencies # Waifu2x-caffe available from: https://github.com/lltcggie/waifu2x-caffe/releases # -mode_dir options # models\anime_style_art_rgb: 2-dimensional image model for converting all RGB # models\anime_style_art: model for two-dimensional image that converts only luminance # models\photo: Photos that convert ...
2.263386
2
example_project/example_app/models.py
liberation/django-carrier-pigeon
5
6623716
<gh_stars>1-10 # -*- coding: utf-8 -*- from django.db import models from extended_choices import Choices from carrier_pigeon.models import BasicDirtyFieldsMixin WORKFLOW_STATE = Choices( ('OFFLINE', 10, u'Hors ligne'), ('ONLINE', 20, u'En ligne'), ('DELETED', 99, u'Supprimé'), ) class Photo(models.Model)...
# -*- coding: utf-8 -*- from django.db import models from extended_choices import Choices from carrier_pigeon.models import BasicDirtyFieldsMixin WORKFLOW_STATE = Choices( ('OFFLINE', 10, u'Hors ligne'), ('ONLINE', 20, u'En ligne'), ('DELETED', 99, u'Supprimé'), ) class Photo(models.Model): """One co...
en
0.693644
# -*- coding: utf-8 -*- One content illustration. One content object of a news site.
2.292847
2
pipeit/__init__.py
GoodManWEN/pipe
3
6623717
<filename>pipeit/__init__.py<gh_stars>1-10 __author__ = 'WEN (github.com/GoodManWEN)' __version__ = '' from .utils import * from .wrapper import * from .timer import timeit from .io import * __all__ = ( 'timeit', 'PIPE', 'END', 'Filter', 'Map', 'Reduce', 'Read', 'Write' )
<filename>pipeit/__init__.py<gh_stars>1-10 __author__ = 'WEN (github.com/GoodManWEN)' __version__ = '' from .utils import * from .wrapper import * from .timer import timeit from .io import * __all__ = ( 'timeit', 'PIPE', 'END', 'Filter', 'Map', 'Reduce', 'Read', 'Write' )
none
1
1.058932
1
libevent/client.py
matrix65537/lab
0
6623718
#!/usr/bin/python #coding:utf8 import socket import time IP = "127.0.0.1" PORT = 9995 max_sock_count = 100 addr = (IP, PORT) sock_list = [] for i in range(max_sock_count): print "connect", i s = socket.socket(2, 1, 0) s.connect(addr) sock_list.append(s) for i in range(max_sock_count): s = sock_l...
#!/usr/bin/python #coding:utf8 import socket import time IP = "127.0.0.1" PORT = 9995 max_sock_count = 100 addr = (IP, PORT) sock_list = [] for i in range(max_sock_count): print "connect", i s = socket.socket(2, 1, 0) s.connect(addr) sock_list.append(s) for i in range(max_sock_count): s = sock_l...
ru
0.160139
#!/usr/bin/python #coding:utf8
3.037764
3
app/utils.py
chushijituan/job_analysis
45
6623719
<filename>app/utils.py<gh_stars>10-100 # coding: utf-8 import traceback import logging from functools import wraps from flask import abort, current_app from werkzeug.exceptions import HTTPException logger = logging.getLogger() def handle_exception(func): ''' Since the flask does not provide a function for c...
<filename>app/utils.py<gh_stars>10-100 # coding: utf-8 import traceback import logging from functools import wraps from flask import abort, current_app from werkzeug.exceptions import HTTPException logger = logging.getLogger() def handle_exception(func): ''' Since the flask does not provide a function for c...
en
0.888474
# coding: utf-8 Since the flask does not provide a function for catching and analysing the exceptions, it's difficult that knowing what happened on the fly. If you decorate a view with this, the wrapper can handle the exceptions and log it automatically. :param func: The view function to decorate. ...
2.498326
2
app/send_email.py
maxwellwachira/FastAPI-Mail
1
6623720
from fastapi import FastAPI, BackgroundTasks from fastapi.templating import Jinja2Templates from fastapi.responses import HTMLResponse from fastapi_mail import FastMail, MessageSchema, ConnectionConfig from starlette.responses import JSONResponse from starlette.requests import Request from decouple import config from a...
from fastapi import FastAPI, BackgroundTasks from fastapi.templating import Jinja2Templates from fastapi.responses import HTMLResponse from fastapi_mail import FastMail, MessageSchema, ConnectionConfig from starlette.responses import JSONResponse from starlette.requests import Request from decouple import config from a...
en
0.632786
#Landing page template #Send Email Asynchronously #SEnd Email using Background Tasks
2.327624
2
006-ZigZag-Conversion/solution01.py
Eroica-cpp/LeetCode
7
6623721
#!/usr/bin/python # ============================================================================== # Author: <NAME> (<EMAIL>) # Date: May 1, 2015 # Question: 006-ZigZag-Conversion # Link: https://leetcode.com/problems/zigzag-conversion/ # =======================================================================...
#!/usr/bin/python # ============================================================================== # Author: <NAME> (<EMAIL>) # Date: May 1, 2015 # Question: 006-ZigZag-Conversion # Link: https://leetcode.com/problems/zigzag-conversion/ # =======================================================================...
en
0.551294
#!/usr/bin/python # ============================================================================== # Author: <NAME> (<EMAIL>) # Date: May 1, 2015 # Question: 006-ZigZag-Conversion # Link: https://leetcode.com/problems/zigzag-conversion/ # =======================================================================...
4.166969
4
backend/apps/membership/admin.py
jaliste/mi_coop
0
6623722
<reponame>jaliste/mi_coop from django.contrib import admin # Register your models here. from .models import CoopMember, Coop @admin.register(CoopMember) class CoopMemberadmin(admin.ModelAdmin): change_list_template = 'admin/change_list.html' @admin.register(Coop) class Coop(admin.ModelAdmin): pass
from django.contrib import admin # Register your models here. from .models import CoopMember, Coop @admin.register(CoopMember) class CoopMemberadmin(admin.ModelAdmin): change_list_template = 'admin/change_list.html' @admin.register(Coop) class Coop(admin.ModelAdmin): pass
en
0.968259
# Register your models here.
1.387264
1
test_gauss.py
Basi1i0/LightPipesPulses
0
6623723
# -*- coding: utf-8 -*- """ Created on Mon Aug 13 17:41:21 2018 @author: Basil """ import matplotlib.pyplot as plt import gc import numpy import random from joblib import Parallel, delayed from LightPipes import cm, mm, nm import scipy import StepsGenerator import copy def AxiconZ(z): return 2*numpy.pi* k0**2...
# -*- coding: utf-8 -*- """ Created on Mon Aug 13 17:41:21 2018 @author: Basil """ import matplotlib.pyplot as plt import gc import numpy import random from joblib import Parallel, delayed from LightPipes import cm, mm, nm import scipy import StepsGenerator import copy def AxiconZ(z): return 2*numpy.pi* k0**2...
en
0.184369
# -*- coding: utf-8 -*- Created on Mon Aug 13 17:41:21 2018 @author: Basil # 2*numpy.pi*z/a**2/k0*numpy.exp( - z**2 /a**2 /k0**2 / w1**2 ) #for scale in range(0,20): #print(scale) #f/k0/(1*mm) #sigma_zw #0.0005 #x.RandomPhase(1, 1) #x.Forvard(f) #x.Lens(f, 0.00, 0) #x.Forvard(2*f) #x.Lens(f, 0.00, 0) # xc = copy.de...
2.059003
2
setup.py
NickWoods1/pcask1d
1
6623724
from setuptools import setup, find_packages # User defines the location of the script output, and which method is being used. #Version of the test suite used __version__ = 0.1 setup( name = 'pcask1d', version = __version__, description = 'Find the ground state energy given a certain approximation to the ...
from setuptools import setup, find_packages # User defines the location of the script output, and which method is being used. #Version of the test suite used __version__ = 0.1 setup( name = 'pcask1d', version = __version__, description = 'Find the ground state energy given a certain approximation to the ...
en
0.921192
# User defines the location of the script output, and which method is being used. #Version of the test suite used
1.633774
2
modules/training_helper.py
BoyoChen/TCSA-CNN_profiler
2
6623725
<gh_stars>1-10 import tensorflow as tf import numpy as np from modules.feature_generator import load_dataset from modules.image_processor import image_augmentation, evenly_rotate import matplotlib.pyplot as plt import imageio def draw_profile_chart(profile, pred_profile, calculated_Vmax, calculated_R34): km = np....
import tensorflow as tf import numpy as np from modules.feature_generator import load_dataset from modules.image_processor import image_augmentation, evenly_rotate import matplotlib.pyplot as plt import imageio def draw_profile_chart(profile, pred_profile, calculated_Vmax, calculated_R34): km = np.arange(0, 751, ...
none
1
2.47517
2
tests/test_config_examples.py
turing4ever/flask_jsondash
3,503
6623726
""" Test the validation for the core configuration schema. Also test any example config files. """ import os import json import pytest from flask_jsondash import schema ROOT_DIR = 'example_app/examples/config' def get_example_configs(): return [ f for f in os.listdir(ROOT_DIR) if f.endswith('...
""" Test the validation for the core configuration schema. Also test any example config files. """ import os import json import pytest from flask_jsondash import schema ROOT_DIR = 'example_app/examples/config' def get_example_configs(): return [ f for f in os.listdir(ROOT_DIR) if f.endswith('...
en
0.325978
Test the validation for the core configuration schema. Also test any example config files.
2.628419
3
sotd/frontend/routes.py
huntermatthews/sot
0
6623727
<filename>sotd/frontend/routes.py # -*- coding: utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import frontend def add_routes(app): # Application level API app.add_url_rule('/', 'summary', fronten...
<filename>sotd/frontend/routes.py # -*- coding: utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import frontend def add_routes(app): # Application level API app.add_url_rule('/', 'summary', fronten...
en
0.433536
# -*- coding: utf-8 -*- # Application level API # DEBUG API # COLLECTIONS API # ITEMS API ## END OF LINE ##
2.194052
2
api/src/api/endpoints/send_gift.py
whynft/nft-gift-button-backend
0
6623728
<filename>api/src/api/endpoints/send_gift.py from fastapi import APIRouter, status from fastapi.responses import JSONResponse import schemas from config.misc import redis from utils.logger import get_app_logger from utils.redisdb import NftGiftRedisKeys from utils.security import create_verification_code, get_verifica...
<filename>api/src/api/endpoints/send_gift.py from fastapi import APIRouter, status from fastapi.responses import JSONResponse import schemas from config.misc import redis from utils.logger import get_app_logger from utils.redisdb import NftGiftRedisKeys from utils.security import create_verification_code, get_verifica...
none
1
2.475294
2
Textbook/Chapter 5/twoDimList.py
hunterluepke/Learn-Python-for-Stats-and-Econ
16
6623729
#twoDimensionalListAndNumpyArray.py import numpy as np twoDimList = [[1,2,3,4],[2,3,4,5]] print(twoDimList) twoDimArray = np.array(twoDimList) print(twoDimArray) for i in range(len(twoDimList)): print(twoDimList[i]) print(twoDimArray[i]) for j in range(len(twoDimList[i])): print(twoDimList[i][j]) ...
#twoDimensionalListAndNumpyArray.py import numpy as np twoDimList = [[1,2,3,4],[2,3,4,5]] print(twoDimList) twoDimArray = np.array(twoDimList) print(twoDimArray) for i in range(len(twoDimList)): print(twoDimList[i]) print(twoDimArray[i]) for j in range(len(twoDimList[i])): print(twoDimList[i][j]) ...
en
0.210205
#twoDimensionalListAndNumpyArray.py
3.662378
4
src/wizard/view/clsMain.py
UCHIC/ODMStreamingDataLoader
0
6623730
<reponame>UCHIC/ODMStreamingDataLoader import os import wx from ..media.images import blue_add, blue_remove, blue_edit, blue_run class MainView(wx.Frame): def __init__(self, parent, **kwargs): super(MainView, self).__init__(parent, id=wx.ID_ANY, ...
import os import wx from ..media.images import blue_add, blue_remove, blue_edit, blue_run class MainView(wx.Frame): def __init__(self, parent, **kwargs): super(MainView, self).__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosi...
en
0.156809
#tsize = (30, 30) # path = os.path.dirname(\ # os.path.dirname(os.path.realpath(__file__))) # new_bmp = scaleBitmap(wx.Bitmap(\ # path + '/media/blue_add.png',\ # wx.BITMAP_TYPE_PNG), tsize) # del_bmp = scaleBitmap(wx.Bitmap(\ # path + '/media/blue_remove.png',\ # wx.BITMAP_TYPE_PNG), tsize) # edit_...
2.297593
2
profiling/output_profiling.py
ahamilton144/CALFEWS
3
6623731
import pstats import sys name = sys.argv[1] mode = sys.argv[2] p = pstats.Stats("profile_" + name + ".stats") p.sort_stats("cumulative") if mode == 'cumulative': p.print_stats() elif mode == 'caller': p.print_callers() elif mode == 'callee': p.print_callees()
import pstats import sys name = sys.argv[1] mode = sys.argv[2] p = pstats.Stats("profile_" + name + ".stats") p.sort_stats("cumulative") if mode == 'cumulative': p.print_stats() elif mode == 'caller': p.print_callers() elif mode == 'callee': p.print_callees()
none
1
2.40491
2
scripts/ITAC/parse-output.py
ahueck/MPI-Corrbench
2
6623732
# TODO documentation at different location # input: # input_dir: the directory where the tool was run and output was captured # is_error_expected: bool if an error is expected # error_specification: information read from error-classification.json # return values: # error_found count off errors found # -1 means could ...
# TODO documentation at different location # input: # input_dir: the directory where the tool was run and output was captured # is_error_expected: bool if an error is expected # error_specification: information read from error-classification.json # return values: # error_found count off errors found # -1 means could ...
en
0.839642
# TODO documentation at different location # input: # input_dir: the directory where the tool was run and output was captured # is_error_expected: bool if an error is expected # error_specification: information read from error-classification.json # return values: # error_found count off errors found # -1 means could no...
2.626733
3
examples/Test.py
Ellis0817/Introduction-to-Programming-Using-Python
0
6623733
<filename>examples/Test.py myList = [1, 2, 3, 4, 5, 6] for i in range(4, -1, -1): myList[i + 1] = myList[i] for i in range(0, 6): print(myList[i], end = " ")
<filename>examples/Test.py myList = [1, 2, 3, 4, 5, 6] for i in range(4, -1, -1): myList[i + 1] = myList[i] for i in range(0, 6): print(myList[i], end = " ")
none
1
3.804368
4
Chapter05/restful_python_2_05/Django01/games_service/games/serializers.py
PacktPublishing/Hands-On-RESTful-Python-Web-Services-Second-Edition
45
6623734
from rest_framework import serializers from games.models import Game class GameSerializer(serializers.Serializer): id = serializers.IntegerField(read_only=True) name = serializers.CharField(max_length=200) release_date = serializers.DateTimeField() esrb_rating = serializers.CharField(max_length=150) ...
from rest_framework import serializers from games.models import Game class GameSerializer(serializers.Serializer): id = serializers.IntegerField(read_only=True) name = serializers.CharField(max_length=200) release_date = serializers.DateTimeField() esrb_rating = serializers.CharField(max_length=150) ...
none
1
2.320117
2
pi_py/wdactions/cli.py
Bengreen/PiPowerMgt
0
6623735
#!/usr/bin/venv python import click from .watchdog import PiWatchDog from .wdsystemd import watchdogd @click.group() def cli(): pass @cli.command() @click.argument("id", type=int) @click.argument("state", type=click.Choice(["on", "off"])) @click.option("--address", "address", type=int, default=0x08) def power(a...
#!/usr/bin/venv python import click from .watchdog import PiWatchDog from .wdsystemd import watchdogd @click.group() def cli(): pass @cli.command() @click.argument("id", type=int) @click.argument("state", type=click.Choice(["on", "off"])) @click.option("--address", "address", type=int, default=0x08) def power(a...
ru
0.271363
#!/usr/bin/venv python
2.625278
3
ml/myscript/knn.py
miraclestatus/mllearning
1
6623736
<gh_stars>1-10 from sklearn.model_selection import train_test_split
from sklearn.model_selection import train_test_split
none
1
1.210468
1
api/src/application/rest_api/task_status/schemas.py
iliaskaras/housing-units
0
6623737
<gh_stars>0 from typing import Optional, Any from pydantic import BaseModel class TaskStatus(BaseModel): task_id: Optional[str] task_status: Optional[str] task_result: Optional[Any] class Config: schema_extra = { "example": { "task_id": "e3b3326c-617a-4836-8fe0-3c...
from typing import Optional, Any from pydantic import BaseModel class TaskStatus(BaseModel): task_id: Optional[str] task_status: Optional[str] task_result: Optional[Any] class Config: schema_extra = { "example": { "task_id": "e3b3326c-617a-4836-8fe0-3c17390f0bd4",...
none
1
2.654616
3
timebox/notify.py
DerFlob/timebox-home-assistant
0
6623738
from .const import DOMAIN import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_NAME, CONF_URL import voluptuous as vol import logging from homeassistant.components.notify import ATTR_TARGET, ATTR_DATA,PLATFORM_SCHEMA, BaseNotificationService import requests import io from os.path im...
from .const import DOMAIN import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_NAME, CONF_URL import voluptuous as vol import logging from homeassistant.components.notify import ATTR_TARGET, ATTR_DATA,PLATFORM_SCHEMA, BaseNotificationService import requests import io from os.path im...
none
1
2.239424
2
solution1.py
doriszd/http-github.com-yourusername-pands-problem-set
1
6623739
<gh_stars>1-10 # <NAME>, February, 2019 # Solution to problem 1 # User is asked to enter a positive integer x = int(input("Please enter a positive integer: ")) # a = range of all numbers from 1 to entered number a = range(1, x) # b = sum of all numbers in a range from 1 up to entered number b = sum(a) # Print the sum ...
# <NAME>, February, 2019 # Solution to problem 1 # User is asked to enter a positive integer x = int(input("Please enter a positive integer: ")) # a = range of all numbers from 1 to entered number a = range(1, x) # b = sum of all numbers in a range from 1 up to entered number b = sum(a) # Print the sum of all numbers ...
en
0.907938
# <NAME>, February, 2019 # Solution to problem 1 # User is asked to enter a positive integer # a = range of all numbers from 1 to entered number # b = sum of all numbers in a range from 1 up to entered number # Print the sum of all numbers up to entered number # If entered number is lower than 0 print "Please enter int...
4.141045
4
wideryolo/file_utils/file_utils.py
fcakyon/wideryolo-1
0
6623740
<filename>wideryolo/file_utils/file_utils.py from zipfile import ZipFile import shutil import glob import os def create_dir(_dir): if not os.path.exists(_dir): os.makedirs(_dir) def zip_export(save_path): with ZipFile(save_path, 'r') as zip: zip.extractall() os.remove(save_path) def wi...
<filename>wideryolo/file_utils/file_utils.py from zipfile import ZipFile import shutil import glob import os def create_dir(_dir): if not os.path.exists(_dir): os.makedirs(_dir) def zip_export(save_path): with ZipFile(save_path, 'r') as zip: zip.extractall() os.remove(save_path) def wi...
none
1
2.768835
3
slack-api-delete-files.py
AntonioFeijaoUK/slack-api-delete-files.py
0
6623741
### credits go to @henry-p and @jackcarter ### copied code from here https://gist.github.com/jackcarter/d86808449f0d95060a40#gistcomment-2272461 ### initial gist from here https://gist.github.com/jackcarter/d86808449f0d95060a40 ### minor changes to my preference, file size grater than 0 mb, so deletes all files more th...
### credits go to @henry-p and @jackcarter ### copied code from here https://gist.github.com/jackcarter/d86808449f0d95060a40#gistcomment-2272461 ### initial gist from here https://gist.github.com/jackcarter/d86808449f0d95060a40 ### minor changes to my preference, file size grater than 0 mb, so deletes all files more th...
en
0.793957
### credits go to @henry-p and @jackcarter ### copied code from here https://gist.github.com/jackcarter/d86808449f0d95060a40#gistcomment-2272461 ### initial gist from here https://gist.github.com/jackcarter/d86808449f0d95060a40 ### minor changes to my preference, file size grater than 0 mb, so deletes all files more th...
2.609827
3
common/common.py
developer-foundry/diminish
14
6623742
<gh_stars>10-100 """ This script shares common functions and variables needed by the CLI and TUI scripts. """ import os from pathlib import Path import logging from dotenv import load_dotenv env_path = Path('./environment') / '.env' load_dotenv(dotenv_path=env_path) mu = 0.00001 """ Utilized by the CRLS algorithm to...
""" This script shares common functions and variables needed by the CLI and TUI scripts. """ import os from pathlib import Path import logging from dotenv import load_dotenv env_path = Path('./environment') / '.env' load_dotenv(dotenv_path=env_path) mu = 0.00001 """ Utilized by the CRLS algorithm to determine the st...
en
0.678958
This script shares common functions and variables needed by the CLI and TUI scripts. Utilized by the CRLS algorithm to determine the step of gradient descent algorithm This timer is used by the tui application to determine how long in between a screen refresh Used to determine the root folder when the tui application s...
2.79041
3
bin/Python27/Lib/site-packages/tables/tests/create_backcompat_indexes.py
lefevre-fraser/openmeta-mms
0
6623743
<filename>bin/Python27/Lib/site-packages/tables/tests/create_backcompat_indexes.py<gh_stars>0 # -*- coding: utf-8 -*- # Script for creating different kind of indexes in a small space as possible. # This is intended for testing purposes. import tables class Descr(tables.IsDescription): var1 = tables.Str...
<filename>bin/Python27/Lib/site-packages/tables/tests/create_backcompat_indexes.py<gh_stars>0 # -*- coding: utf-8 -*- # Script for creating different kind of indexes in a small space as possible. # This is intended for testing purposes. import tables class Descr(tables.IsDescription): var1 = tables.Str...
en
0.82293
# -*- coding: utf-8 -*- # Script for creating different kind of indexes in a small space as possible. # This is intended for testing purposes. # Parameters for the table and index creation # Create the new file # Do a copy of table1 # Create indexes of all kinds
2.332006
2
qrgui.py
wooihaw/qrgui
0
6623744
<reponame>wooihaw/qrgui import PySimpleGUI as sg import pyqrcode # Convert from color code to tuple of RGB values plus alpha def color_code_to_tuple(color_code): c = (eval("0x" + color_code[i : i + 2]) for i in (1, 3, 5)) return tuple(c) + (255,) input_layout = sg.Frame( "Input text", [[sg.InputText(key=...
import PySimpleGUI as sg import pyqrcode # Convert from color code to tuple of RGB values plus alpha def color_code_to_tuple(color_code): c = (eval("0x" + color_code[i : i + 2]) for i in (1, 3, 5)) return tuple(c) + (255,) input_layout = sg.Frame( "Input text", [[sg.InputText(key="-IN-", expand_x=True)]]...
en
0.56707
# Convert from color code to tuple of RGB values plus alpha # Create the window # Set default colors # Create an event loop # End program if user closes window or # presses the Exit button # Generate QR Code # Save QR Code
2.862779
3
stylelens/dataset/df/extract_object.py
williamcameron/bl-magi
0
6623745
<gh_stars>0 import os from bson.objectid import ObjectId from stylelens_dataset.images import Images from stylelens_dataset.objects import Objects from util import s3 import urllib.request from PIL import Image AWS_BUCKET = 'stylelens-dataset' AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY'].replace('"', '') AWS_SECRET_...
import os from bson.objectid import ObjectId from stylelens_dataset.images import Images from stylelens_dataset.objects import Objects from util import s3 import urllib.request from PIL import Image AWS_BUCKET = 'stylelens-dataset' AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY'].replace('"', '') AWS_SECRET_ACCESS_KEY =...
none
1
2.474064
2
src/crumhorn/configuration/environment/environment.py
jelford/crumhorn
0
6623746
# coding=utf-8 import os from crumhorn.configuration.environment import machinespec_repository class CrumhornEnvironment: def __init__(self, machinespec_repository, cloud_config): self.cloud_config = cloud_config self.machinespec_repository = machinespec_repository def build_environment(): ...
# coding=utf-8 import os from crumhorn.configuration.environment import machinespec_repository class CrumhornEnvironment: def __init__(self, machinespec_repository, cloud_config): self.cloud_config = cloud_config self.machinespec_repository = machinespec_repository def build_environment(): ...
en
0.644078
# coding=utf-8
2.147379
2
packages/swapi_matches.py
palaciodaniel/lambda-swapi
0
6623747
import requests import time from fuzzywuzzy import fuzz from typing import List, Optional def get_swapi_matches(name_one: str, name_two: str) -> List[Optional[List]]: """ Looks for the inputted characters on the SWAPI database and returns the raw URL for every movie they appear. """ if (len(name...
import requests import time from fuzzywuzzy import fuzz from typing import List, Optional def get_swapi_matches(name_one: str, name_two: str) -> List[Optional[List]]: """ Looks for the inputted characters on the SWAPI database and returns the raw URL for every movie they appear. """ if (len(name...
en
0.900592
Looks for the inputted characters on the SWAPI database and returns the raw URL for every movie they appear. # If both names were found, the loop will be aborted. # If nested lists are not sorted, Unit Tests will fail. # Requesting information to database # Analyzing the results for matches # If both names were fo...
3.22409
3
tools/gyp/test/mac/xcode-env-order/test.gyp
FloeDesignTechnologies/node
17
6623748
<gh_stars>10-100 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'test_app', 'product_name': 'Test', 'type': 'executable', 'mac_bundle': 1, 'sou...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'test_app', 'product_name': 'Test', 'type': 'executable', 'mac_bundle': 1, 'sources': [ ...
en
0.922327
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Env vars in copies. # ${SOURCE_ROOT} doesn't work with xcode # $SOURCE_ROOT doesn't work with xcode # Env vars in actions. # Referencing ${PRODUCT_NAME} in action...
1.550014
2
utils/pascal_voc_loader.py
lejeunel/glia
0
6623749
<reponame>lejeunel/glia<gh_stars>0 import os from os.path import join as pjoin import collections import json import torch import numpy as np import scipy.misc as m import scipy.io as io import matplotlib.pyplot as plt import glob from PIL import Image from tqdm import tqdm from skimage import transform from skimage im...
import os from os.path import join as pjoin import collections import json import torch import numpy as np import scipy.misc as m import scipy.io as io import matplotlib.pyplot as plt import glob from PIL import Image from tqdm import tqdm from skimage import transform from skimage import measure import imgaug as ia im...
en
0.802822
Data loader for the Pascal VOC semantic segmentation dataset. Annotations from both the original VOC data (which consist of RGB images in which colours map to specific classes) and the SBD (Berkely) dataset (where annotations are stored as .mat files) are converted into a common `label_mask` format. U...
2.3028
2
basicts/archs/D2STGNN_arch/DynamicGraphConv/Utils/distance.py
zezhishao/GuanCang_BasicTS
3
6623750
<filename>basicts/archs/D2STGNN_arch/DynamicGraphConv/Utils/distance.py import math import torch import torch.nn as nn import torch.nn.functional as F class DistanceFunction(nn.Module): def __init__(self, **model_args): super().__init__() # attributes self.hidden_dim = model_args['num_hidde...
<filename>basicts/archs/D2STGNN_arch/DynamicGraphConv/Utils/distance.py import math import torch import torch.nn as nn import torch.nn.functional as F class DistanceFunction(nn.Module): def __init__(self, **model_args): super().__init__() # attributes self.hidden_dim = model_args['num_hidde...
en
0.570157
# attributes # hidden dimension of # Time Series Feature Extraction # Time Slot Embedding Extraction # Distance Score # TODO more output dimension # last pooling # dynamic information # X->[batch_size, seq_len, num_nodes]->[batch_size, num_nodes, seq_len] # [batchsize, num_nodes, hidden_dim] # node embedding # distance...
2.464534
2