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
Language Proficiency/Python/Write a function.py
RishabhArya/HackerRank-Solutions
3
6627351
def is_leap(year): leap = False if (year%400 == 0): leap = True elif (year%100 == 0): leap = False elif (year%4 == 0): leap = True return leap year = int(input()) print(is_leap(year))
def is_leap(year): leap = False if (year%400 == 0): leap = True elif (year%100 == 0): leap = False elif (year%4 == 0): leap = True return leap year = int(input()) print(is_leap(year))
none
1
4.093542
4
flask_monitoringdashboard/views/__init__.py
bokal2/Flask-MonitoringDashboard
3
6627352
""" Main class for adding all route-functions to user_app. Setup requires only to import this file. All other imports are done in this file """ from flask import render_template from flask.helpers import send_from_directory from flask_monitoringdashboard import loc, blueprint from flask_monitoringdashboard.cor...
""" Main class for adding all route-functions to user_app. Setup requires only to import this file. All other imports are done in this file """ from flask import render_template from flask.helpers import send_from_directory from flask_monitoringdashboard import loc, blueprint from flask_monitoringdashboard.cor...
en
0.761097
Main class for adding all route-functions to user_app. Setup requires only to import this file. All other imports are done in this file Serve static files :param filename: filename in the /static file :return: content of the file # Catch-All URL: http://flask.pocoo.org/snippets/57/
2.221347
2
dit_helpdesk/iee_contact/views.py
uktrade/dit-helpdesk
3
6627353
<gh_stars>1-10 import logging from directory_forms_api_client import helpers from django.conf import settings from django.core.mail import EmailMessage from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.loader import get_template from formtools.wizard.views import Ses...
import logging from directory_forms_api_client import helpers from django.conf import settings from django.core.mail import EmailMessage from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.loader import get_template from formtools.wizard.views import SessionWizardView ...
en
0.686131
# if the chosen topic is in the last four options then go to zendesk # otherwise send an email override next steps for step five if enquiry_topic is Commodity codes, tariffs and measures, import procedures :param form: submitted form :param kwargs: passed keyword arguments :return: rende...
1.895047
2
model/tests/conftest.py
logan-connolly/imdb
0
6627354
from pathlib import Path import pytest from src.data import paths @pytest.fixture def mock_data_dir(monkeypatch): """Patch DATAPATH constant to point to test data directory""" mock_data_dir = Path(__file__).parent / "data" monkeypatch.setattr(paths, "DATAPATH", mock_data_dir) return mock_data_dir
from pathlib import Path import pytest from src.data import paths @pytest.fixture def mock_data_dir(monkeypatch): """Patch DATAPATH constant to point to test data directory""" mock_data_dir = Path(__file__).parent / "data" monkeypatch.setattr(paths, "DATAPATH", mock_data_dir) return mock_data_dir
en
0.734947
Patch DATAPATH constant to point to test data directory
2.187303
2
python/obsolete/sketcher/sketch_4578.py
geometer/sandbox
6
6627355
# "Romantics of Geometry" group on Facebook, problem 4578 # https://www.facebook.com/groups/parmenides52/permalink/2779763428804012/ from sandbox import Scene from sketcher import sketch scene = Scene() triangle = scene.nondegenerate_triangle(labels=('A', 'B', 'C')) D = scene.orthocentre_point(triangle, label='D') D...
# "Romantics of Geometry" group on Facebook, problem 4578 # https://www.facebook.com/groups/parmenides52/permalink/2779763428804012/ from sandbox import Scene from sketcher import sketch scene = Scene() triangle = scene.nondegenerate_triangle(labels=('A', 'B', 'C')) D = scene.orthocentre_point(triangle, label='D') D...
en
0.583898
# "Romantics of Geometry" group on Facebook, problem 4578 # https://www.facebook.com/groups/parmenides52/permalink/2779763428804012/
2.701976
3
tests/selenium/alarms_test/Alarms_Menu_test.py
sivaanil/laravel
1
6627356
<reponame>sivaanil/laravel<filename>tests/selenium/alarms_test/Alarms_Menu_test.py<gh_stars>1-10 __author__ = 'andrew.bascom' # -*- coding: utf-8 -*- import sys sys.path.append("..") import c2_test_case from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from ...
__author__ = 'andrew.bascom' # -*- coding: utf-8 -*- import sys sys.path.append("..") import c2_test_case from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expecte...
en
0.801883
# -*- coding: utf-8 -*- #Get the driver # Move the divider to allow room for best viewing of the buttons, columns, and tabs # Wait for the auto resize checkbox to be displayed then store it # If the auto resize chackbox is selected click it to deselect it # Wait till the divider is available and store it # Emulate movi...
2.247168
2
mac_face_detection.py
MinxZ/iqiyi_ai
0
6627357
<reponame>MinxZ/iqiyi_ai<gh_stars>0 import glob import multiprocessing import os import pickle from collections import defaultdict import cv2 as cv2 import face_recognition import numpy as np from tqdm import tqdm from model import resizeAndPad # %matplotlib inline # %% data_path = '../data/IQIYI_VID_DATA_Part1' png...
import glob import multiprocessing import os import pickle from collections import defaultdict import cv2 as cv2 import face_recognition import numpy as np from tqdm import tqdm from model import resizeAndPad # %matplotlib inline # %% data_path = '../data/IQIYI_VID_DATA_Part1' png_list = glob.glob(f'{data_path}/png_...
tr
0.120857
# %matplotlib inline # %% # %% # %%
2.473807
2
openks/models/pytorch/mmd_modules/ThreeDVG/scripts/ScanRefer_train.py
vivym/OpenKS
0
6627358
<filename>openks/models/pytorch/mmd_modules/ThreeDVG/scripts/ScanRefer_train.py<gh_stars>0 import os import sys import json import h5py import argparse import importlib import torch import torch.optim as optim import torch.nn as nn import numpy as np import pickle from torch.utils.data import DataLoader from datetime ...
<filename>openks/models/pytorch/mmd_modules/ThreeDVG/scripts/ScanRefer_train.py<gh_stars>0 import os import sys import json import h5py import argparse import importlib import torch import torch.optim as optim import torch.nn as nn import numpy as np import pickle from torch.utils.data import DataLoader from datetime ...
en
0.428367
# HACK add the root folder # constants # dataloader = DataLoader(dataset, batch_size=args.batch_size, shuffle=True) # initiate model # trainable model # load model # mount # freeze pointnet++ backbone # freeze voting # freeze detector # to CUDA # TODO # params = model.parameters() # scheduler parameters for training so...
1.832826
2
src/api/bkuser_core/categories/constants.py
Canway-shiisa/bk-user
0
6627359
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
en
0.798374
# -*- coding: utf-8 -*- TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License...
1.69763
2
recipes/Python/577612_Seven_Bit_Colored_Analogue_Bar_Graph_Generator/recipe-577612.py
tdiprima/code
2,023
6627360
# SevenBitBargraph2x.py # # A DEMO 7 bit analogue bargraph generator in colour for STANDARD Python 2.6.x and Linux... # # (Original copyright, (C)2010, B.Walker, G0LCU.) # A Python 3.x version can be found here:- # http://www.linuxformat.com/forums/viewtopic.php?t=13443 # # Saved as SevenBitBargraph2x.py wherever you l...
# SevenBitBargraph2x.py # # A DEMO 7 bit analogue bargraph generator in colour for STANDARD Python 2.6.x and Linux... # # (Original copyright, (C)2010, B.Walker, G0LCU.) # A Python 3.x version can be found here:- # http://www.linuxformat.com/forums/viewtopic.php?t=13443 # # Saved as SevenBitBargraph2x.py wherever you l...
en
0.80158
# SevenBitBargraph2x.py # # A DEMO 7 bit analogue bargraph generator in colour for STANDARD Python 2.6.x and Linux... # # (Original copyright, (C)2010, B.Walker, G0LCU.) # A Python 3.x version can be found here:- # http://www.linuxformat.com/forums/viewtopic.php?t=13443 # # Saved as SevenBitBargraph2x.py wherever you l...
3.137243
3
eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/ignore.py
bopopescu/phyG
0
6627361
<reponame>bopopescu/phyG # ignore.py - ignored file handling for mercurial # # Copyright 2007 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import util, match import re _commentre = None def...
# ignore.py - ignored file handling for mercurial # # Copyright 2007 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import util, match import re _commentre = None def ignorepats(lines): '...
en
0.794381
# ignore.py - ignored file handling for mercurial # # Copyright 2007 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. parse lines (iterable) of .hgignore text, returning a tuple of (patterns, parse errors). Thes...
2.663407
3
netbox/utilities/testing/utils.py
esljaz/netbox
2
6627362
import logging import re from contextlib import contextmanager from django.contrib.auth.models import Permission, User def post_data(data): """ Take a dictionary of test data (suitable for comparison to an instance) and return a dict suitable for POSTing. """ ret = {} for key, value in data.item...
import logging import re from contextlib import contextmanager from django.contrib.auth.models import Permission, User def post_data(data): """ Take a dictionary of test data (suitable for comparison to an instance) and return a dict suitable for POSTing. """ ret = {} for key, value in data.item...
en
0.765246
Take a dictionary of test data (suitable for comparison to an instance) and return a dict suitable for POSTing. # Value is a list of instances # Value is an instance Create a User with the given permissions. Given raw HTML content from an HTTP response, return a list of form errors. Temporarily suppress expected warnin...
2.5715
3
bot.py
superik032/xIGDLBot
0
6627363
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is dedicated to the public domain under the CC0 license. # Coded with ❤️ by <NAME> (@NandiyaLive) import telegram from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, run_async import requests from bs4 import BeautifulSoup as bs from te...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is dedicated to the public domain under the CC0 license. # Coded with ❤️ by <NAME> (@NandiyaLive) import telegram from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, run_async import requests from bs4 import BeautifulSoup as bs from te...
en
0.464538
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is dedicated to the public domain under the CC0 license. # Coded with ❤️ by <NAME> (@NandiyaLive) # from instaloader import Instaloader, Profile, Post <b>Usage:</b>\n/stories username - Download stories from the username’s profile.\n/igtv username - Download ...
2.479207
2
ui/wm/wm.gyp
sunjc53yy/chromium
0
6627364
# Copyright 2013 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. { 'variables': { 'chromium_code': 1, }, 'targets': [ { # GN version: //ui/wm 'target_name': 'wm', 'type': '<(component)', ...
# Copyright 2013 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. { 'variables': { 'chromium_code': 1, }, 'targets': [ { # GN version: //ui/wm 'target_name': 'wm', 'type': '<(component)', ...
en
0.84014
# Copyright 2013 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. # GN version: //ui/wm # Note: sources list duplicated in GN build. # GN version: //ui/wm:test_support # GN version: //ui/wm:wm_unittests
1.115604
1
third_party/blink/public/mojom/feature_policy/PRESUBMIT.py
sarang-apps/darshan_browser
0
6627365
# Copyright 2018 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. """Blink feature-policy presubmit script. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit AP...
# Copyright 2018 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. """Blink feature-policy presubmit script. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit AP...
en
0.809231
# Copyright 2018 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. Blink feature-policy presubmit script. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API b...
1.943273
2
Courses/EE6226/Software/make_language_inclusion_test.py
ldkong1205/ntu-graduate-courses
22
6627366
<reponame>ldkong1205/ntu-graduate-courses #!/usr/bin/env python # $Id: make_language_inclusion_test.py 538 2009-11-09 14:51:19Z hat $ """ Check whether the 'small' language is contained in the 'big' language. """ import sys # Make sure the installed version is used (is in the Python path). site_packages = "%SITE...
#!/usr/bin/env python # $Id: make_language_inclusion_test.py 538 2009-11-09 14:51:19Z hat $ """ Check whether the 'small' language is contained in the 'big' language. """ import sys # Make sure the installed version is used (is in the Python path). site_packages = "%SITEPACKAGES%" if not site_packages.startswit...
en
0.66318
#!/usr/bin/env python # $Id: make_language_inclusion_test.py 538 2009-11-09 14:51:19Z hat $ Check whether the 'small' language is contained in the 'big' language. # Make sure the installed version is used (is in the Python path). # Installed version, prefix installed path.
2.664626
3
reportlab/lib/attrmap.py
gustavohenrique/wms
1
6627367
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/attrmap.py __version__=''' $Id: attrmap.py 3342 2008-12-12 15:55:34Z andy $ ''' __doc__='''Framework for objects whose assignments are checked. Use...
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/attrmap.py __version__=''' $Id: attrmap.py 3342 2008-12-12 15:55:34Z andy $ ''' __doc__='''Framework for objects whose assignments are checked. Use...
en
0.713501
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/attrmap.py $Id: attrmap.py 3342 2008-12-12 15:55:34Z andy $ Framework for objects whose assignments are checked. Used by graphics. We developed re...
2.275162
2
genomicfeatures/migrations/0002_auto_20190523_1346.py
brand-fabian/varfish-server
14
6627368
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-23 13:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("genomicfeatures", "0001_initial")] operations = [ migrations.AddIndex( mode...
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-23 13:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("genomicfeatures", "0001_initial")] operations = [ migrations.AddIndex( mode...
en
0.68232
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-23 13:46
1.344908
1
bin/Reinteract.pyw
alexey4petrov/reinteract
1
6627369
<reponame>alexey4petrov/reinteract #!/usr/bin/env python # # Copyright 2007-2009 <NAME> # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ####################################################################...
#!/usr/bin/env python # # Copyright 2007-2009 <NAME> # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import os import sys script_...
en
0.39727
#!/usr/bin/env python # # Copyright 2007-2009 <NAME> # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ########################################################################
1.904929
2
eonr/tests/test_eonr.py
tnigon/eonr
3
6627370
<gh_stars>1-10 # -*- coding: utf-8 -*- ''' Set up a test to run through all of the functions (and various options) and provide a report on how many were returned with errors (coverage). Then this file can be run anytime a change is made and changes are pushed to see if anything was broken The following test uses a ve...
# -*- coding: utf-8 -*- ''' Set up a test to run through all of the functions (and various options) and provide a report on how many were returned with errors (coverage). Then this file can be run anytime a change is made and changes are pushed to see if anything was broken The following test uses a very small "test"...
en
0.939362
# -*- coding: utf-8 -*- Set up a test to run through all of the functions (and various options) and provide a report on how many were returned with errors (coverage). Then this file can be run anytime a change is made and changes are pushed to see if anything was broken The following test uses a very small "test" dat...
2.669887
3
utils/utils.py
kaitolucifer/flask-restful-web-app
0
6627371
<reponame>kaitolucifer/flask-restful-web-app import re import base64 class AuthenticationFailedError(Exception): def __init__(self, message="Authentication Failed"): super().__init__(message) class NotUpdatableError(Exception): def __init__(self, message="not updatable user_id and password"): ...
import re import base64 class AuthenticationFailedError(Exception): def __init__(self, message="Authentication Failed"): super().__init__(message) class NotUpdatableError(Exception): def __init__(self, message="not updatable user_id and password"): super().__init__(message) def get_auth(re...
none
1
2.751386
3
pysyncobj/tcp_connection.py
briangu/PySyncObj
602
6627372
import time import socket import zlib import struct import pysyncobj.pickle as pickle import pysyncobj.win_inet_pton from .poller import POLL_EVENT_TYPE from .monotonic import monotonic as monotonicTime class CONNECTION_STATE: DISCONNECTED = 0 CONNECTING = 1 CONNECTED = 2 def _getAddrType(addr): tr...
import time import socket import zlib import struct import pysyncobj.pickle as pickle import pysyncobj.win_inet_pton from .poller import POLL_EVENT_TYPE from .monotonic import monotonic as monotonicTime class CONNECTION_STATE: DISCONNECTED = 0 CONNECTING = 1 CONNECTED = 2 def _getAddrType(addr): tr...
none
1
2.520619
3
test/test_download_with_metadata.py
volgar1x/spotify-downloader
0
6627373
<filename>test/test_download_with_metadata.py import subprocess import os from spotdl import const from spotdl import internals from spotdl import spotify_tools from spotdl import youtube_tools from spotdl import convert from spotdl import metadata from spotdl import downloader import pytest import loader loader.loa...
<filename>test/test_download_with_metadata.py import subprocess import os from spotdl import const from spotdl import internals from spotdl import spotify_tools from spotdl import youtube_tools from spotdl import convert from spotdl import metadata from spotdl import downloader import pytest import loader loader.loa...
en
0.781535
# GIST_URL is the monkeypatched version of: https://www.youtube.com/results?search_query=janji+-+heroes # so that we get same results even if YouTube changes the list/order of videos on their page. # XXX: We override the value of `content_fixture` later in the tests. # We do not use an acutal @pytest.fixture because it...
2.173948
2
app.py
matthewgall/dnsmasq-viewer
0
6627374
#!/usr/bin/env python import sys, os, logging, json, datetime, time, re, socket from bottle import route, request, response, redirect, hook, error, default_app, view, static_file, template, HTTPError from beaker.cache import CacheManager from beaker.util import parse_cache_config_options def display_time(timestamp): ...
#!/usr/bin/env python import sys, os, logging, json, datetime, time, re, socket from bottle import route, request, response, redirect, hook, error, default_app, view, static_file, template, HTTPError from beaker.cache import CacheManager from beaker.util import parse_cache_config_options def display_time(timestamp): ...
en
0.618548
#!/usr/bin/env python # Now we're ready, so start the server # Instantiate the logger # Now we're ready, so start the server
2.226084
2
hardware/makesrams.py
luismarques/ChiselGPU
40
6627375
#!/usr/bin/python # # Copyright 2015 <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 agr...
#!/usr/bin/python # # Copyright 2015 <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 agr...
en
0.63909
#!/usr/bin/python # # Copyright 2015 <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 ...
2.122468
2
setup.py
drblahdblah/djones-covid19-analysis
0
6627376
<reponame>drblahdblah/djones-covid19-analysis from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.0.1', description=f'A dashboard for visualising my analyses of the Johns Hopkins Univerisity\'s (JHUs)' f' corona-virus dataset.', author...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.0.1', description=f'A dashboard for visualising my analyses of the Johns Hopkins Univerisity\'s (JHUs)' f' corona-virus dataset.', author='<NAME>', license='MIT', )
none
1
1.01879
1
nidaqmx/stream_readers.py
hboshnak/nidaqmx-python
0
6627377
<filename>nidaqmx/stream_readers.py import numpy from nidaqmx import DaqError from nidaqmx.constants import READ_ALL_AVAILABLE from nidaqmx._task_modules.read_functions import ( _read_analog_f_64, _read_analog_scalar_f_64, _read_binary_i_16, _read_binary_i_32, _read_binary_u_16, _read_binary_u_32, _read_di...
<filename>nidaqmx/stream_readers.py import numpy from nidaqmx import DaqError from nidaqmx.constants import READ_ALL_AVAILABLE from nidaqmx._task_modules.read_functions import ( _read_analog_f_64, _read_analog_scalar_f_64, _read_binary_i_16, _read_binary_i_32, _read_binary_u_16, _read_binary_u_32, _read_di...
en
0.849678
Defines base class for all NI-DAQmx stream readers. Args: task_in_stream: Specifies the input stream associated with an NI-DAQmx task from which to read samples. bool: Indicates whether the size and shape of the user-defined NumPy arrays passed to read methods are verified. Defau...
2.321577
2
examples/animations/house.py
colinmford/coldtype
0
6627378
<gh_stars>0 from coldtype import * from coldtype.time.midi import * wav = __sibling__("media/house.wav") obvs = Font("assets/ColdtypeObviously-VF.ttf") midi = Path("examples/animations/media/house.mid").resolve() drums = MidiReader(midi, duration=60, bpm=120)[0] @animation(duration=drums.duration, storyboard=[0], b...
from coldtype import * from coldtype.time.midi import * wav = __sibling__("media/house.wav") obvs = Font("assets/ColdtypeObviously-VF.ttf") midi = Path("examples/animations/media/house.mid").resolve() drums = MidiReader(midi, duration=60, bpm=120)[0] @animation(duration=drums.duration, storyboard=[0], bg=0.1) def r...
none
1
2.161803
2
suplib/config.py
chasemp/sup
1
6627379
<reponame>chasemp/sup import os import ConfigParser home = os.path.expanduser('~') #print os.path.join(home, '.sup.ini') parser = ConfigParser.SafeConfigParser() parser.read('/Users/rush/.sup.ini') def get_config_key(mode, key, strict=False): if mode is None: if parser.has_section('default'): ...
import os import ConfigParser home = os.path.expanduser('~') #print os.path.join(home, '.sup.ini') parser = ConfigParser.SafeConfigParser() parser.read('/Users/rush/.sup.ini') def get_config_key(mode, key, strict=False): if mode is None: if parser.has_section('default'): mode = 'default' e...
en
0.222215
#print os.path.join(home, '.sup.ini')
2.34839
2
qtplot/linecut.py
geresdi/qtplot
15
6627380
<reponame>geresdi/qtplot<gh_stars>10-100 import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import textwrap from itertools import cycle from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT from PyQt4 import QtGui, QtCore from .util import FixedOrderForm...
import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import textwrap from itertools import cycle from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT from PyQt4 import QtGui, QtCore from .util import FixedOrderFormatter, eng_format class Linetrace(plt.L...
en
0.811889
Represents a linetrace from the data. The purpose of this class is to be able to store incremental linetraces in an array. x/y: Arrays containing x and y data type: Type of linetrace, 'horizontal' or 'vertical' position: The x/y coordinate at which the linetrace was taken # Don't show th...
2.48195
2
MiGRIDS/UserInterface/formFromXML.py
mmuellerstoffels/GBSTools
8
6627381
<gh_stars>1-10 #creates a dynamic form based on the information in xml files from PyQt5 import QtWidgets, QtCore, QtGui class formFromXML(QtWidgets.QDialog): def __init__(self, component, componentSoup, write=True): super().__init__() self.componentType = component.type self.componentName =...
#creates a dynamic form based on the information in xml files from PyQt5 import QtWidgets, QtCore, QtGui class formFromXML(QtWidgets.QDialog): def __init__(self, component, componentSoup, write=True): super().__init__() self.componentType = component.type self.componentName = component.comp...
en
0.77255
#creates a dynamic form based on the information in xml files # initialize and display the form #container widget #layout of container widget #a grid layout object #adding scroll layer #create a layout from the xml that was turned into soup #BeautifulSoup QVBoxLayout -> QVBoxLayout #this uses a generic units table #the...
2.7581
3
dart/build_rules/web.bzl
geaden/rules_dart
28
6627382
# Copyright 2016 The Bazel 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 applicable la...
# Copyright 2016 The Bazel 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 applicable la...
en
0.79405
# Copyright 2016 The Bazel 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 applicable la...
1.829386
2
homeassistant/components/demo.py
hemantsangwan/home-assistant
2
6627383
<filename>homeassistant/components/demo.py """ homeassistant.components.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up a demo environment that mimics interaction with devices """ import time import homeassistant as ha import homeassistant.bootstrap as bootstrap import homeassistant.loader as loader from homeassistant....
<filename>homeassistant/components/demo.py """ homeassistant.components.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up a demo environment that mimics interaction with devices """ import time import homeassistant as ha import homeassistant.bootstrap as bootstrap import homeassistant.loader as loader from homeassistant....
en
0.745809
homeassistant.components.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up a demo environment that mimics interaction with devices Setup a demo environment. # Setup sun # Setup demo platforms # Setup room groups # Setup device tracker # Setup configurator Fake callback, mark config as done. # First time it is called, pret...
2.297429
2
idlealib/__init__.py
znsoooo/IDLE-Advance
4
6627384
# Copyright (c) 2021 Lishixian (znsoooo). All Rights Reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT ''' 运行__main__.py获得一个加载所有插件的IDLE-Advance的示例文件。 运行__init__.py获得一个打开自身脚本并加载所有插件的editor的例子。 分别运行idlealib目录下的扩展文件,可以得到一个打开自身的editor或shell的例子。 如果需要停...
# Copyright (c) 2021 Lishixian (znsoooo). All Rights Reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT ''' 运行__main__.py获得一个加载所有插件的IDLE-Advance的示例文件。 运行__init__.py获得一个打开自身脚本并加载所有插件的editor的例子。 分别运行idlealib目录下的扩展文件,可以得到一个打开自身的editor或shell的例子。 如果需要停...
en
0.26492
# Copyright (c) 2021 Lishixian (znsoooo). All Rights Reserved. # # Distributed under MIT license. # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 运行__main__.py获得一个加载所有插件的IDLE-Advance的示例文件。 运行__init__.py获得一个打开自身脚本并加载所有插件的editor的例子。 分别运行idlealib目录下的扩展文件,可以得到一个打开自身的editor或shell的例子。 如果需要停用部分扩展,...
2.171301
2
Exercicios-Desafios python/Exercicios Resolvidos/ex012.py
ThiagoPereira232/python-curso-em-video-mundo01
0
6627385
<reponame>ThiagoPereira232/python-curso-em-video-mundo01 preço = float(input('Qual é o preço do produto? R$')) novo = preço - (preço * 5 / 100) print('O produto que custava R${:.2f}, na promoção com desconto de 5% vai custar R${:.2f}'.format(preço, novo))
preço = float(input('Qual é o preço do produto? R$')) novo = preço - (preço * 5 / 100) print('O produto que custava R${:.2f}, na promoção com desconto de 5% vai custar R${:.2f}'.format(preço, novo))
none
1
3.515155
4
python/bank-account/bank_account.py
alessandrodalbello/my-exercism
0
6627386
<reponame>alessandrodalbello/my-exercism<gh_stars>0 from threading import Lock class BankAccount: def __init__(self): self.is_open = False self.lock = Lock() def open(self): with self.lock: if not self.is_open: self.balance = 0 self.is_open =...
from threading import Lock class BankAccount: def __init__(self): self.is_open = False self.lock = Lock() def open(self): with self.lock: if not self.is_open: self.balance = 0 self.is_open = True else: raise ValueE...
none
1
3.737791
4
test/test_origin.py
frbor/act-admin
0
6627387
<filename>test/test_origin.py import pytest from act.admin.origin import float_or_fatal def test_float_or_fatal_should_fail() -> None: default = 0.8 for value in ("X", "x0.8", "0.8x", {"trust": 0.8}): # https://medium.com/python-pandemonium/testing-sys-exit-with-pytest-10c6e5f7726f with py...
<filename>test/test_origin.py import pytest from act.admin.origin import float_or_fatal def test_float_or_fatal_should_fail() -> None: default = 0.8 for value in ("X", "x0.8", "0.8x", {"trust": 0.8}): # https://medium.com/python-pandemonium/testing-sys-exit-with-pytest-10c6e5f7726f with py...
en
0.699872
# https://medium.com/python-pandemonium/testing-sys-exit-with-pytest-10c6e5f7726f
2.361146
2
geocamPycroraptor2/signals.py
geocam/geocamPycroraptor2
0
6627388
<reponame>geocam/geocamPycroraptor2<gh_stars>0 # __BEGIN_LICENSE__ # Copyright (C) 2008-2010 United States Government as represented by # the Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # __END_LICENSE__ import signal SIG_VERBOSE_CONFIG = [('HUP', 'hangup; e.g. tty was c...
# __BEGIN_LICENSE__ # Copyright (C) 2008-2010 United States Government as represented by # the Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # __END_LICENSE__ import signal SIG_VERBOSE_CONFIG = [('HUP', 'hangup; e.g. tty was closed, unusual under pyraptord'), ...
en
0.851766
# __BEGIN_LICENSE__ # Copyright (C) 2008-2010 United States Government as represented by # the Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # __END_LICENSE__ # doh, can't look up number for signal name on this platform
1.930315
2
rally/common/db/schema.py
CSCfi/rally
0
6627389
<reponame>CSCfi/rally<gh_stars>0 # 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 ...
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
en
0.765257
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
1.938086
2
test/tokenizer_test/tokenize_corpus/local_mode.py
AnonymousAuthor2013/KnowAlpha
2
6627390
<reponame>AnonymousAuthor2013/KnowAlpha<gh_stars>1-10 from programmingalpha.tokenizers import get_tokenizer import programmingalpha import argparse import os import multiprocessing import tqdm from programmingalpha.Utility import getLogger logger=getLogger(__name__) path_map_tokenizers={ "bert":programmingalpha.Be...
from programmingalpha.tokenizers import get_tokenizer import programmingalpha import argparse import os import multiprocessing import tqdm from programmingalpha.Utility import getLogger logger=getLogger(__name__) path_map_tokenizers={ "bert":programmingalpha.BertBaseUnCased, "gpt2": programmingalpha.GPT2Base, ...
en
0.314521
s="You can use [NUM] and [CODE] to finish your work." init() print(tokenizer.tokenizer.vocab_size, len(tokenizer.tokenizer)) print(tokenizer.tokenizer.tokenize(s)) s_t=tokenize(s) print(s) print(s_t)
2.530933
3
tests/test_service.py
IMULMUL/PythonForWindows
479
6627391
import pytest import windows import windows.generated_def as gdef def test_services_process(): services_with_process = [s for s in windows.system.services if s.status.dwProcessId] service = services_with_process[0] proc = service.process assert proc.pid == service.status.dwProcessId def test_servic...
import pytest import windows import windows.generated_def as gdef def test_services_process(): services_with_process = [s for s in windows.system.services if s.status.dwProcessId] service = services_with_process[0] proc = service.process assert proc.pid == service.status.dwProcessId def test_servic...
en
0.459673
# Check other fields # Just start a random serivce with a string # Used to check string compat in py2/py3
2.278495
2
JHarm/Parse/Fail2Ban.py
lukasbalazik123/jharm
1
6627392
<reponame>lukasbalazik123/jharm import AnyToJson import re import os class Fail2Ban(AnyToJson.AnyToJson): def __init__(self): super().__init__() self.i = 0 self.regs = {} self.prepared_regex = {} self.files_readed = [] self.source = self.conf.get("detectio...
import AnyToJson import re import os class Fail2Ban(AnyToJson.AnyToJson): def __init__(self): super().__init__() self.i = 0 self.regs = {} self.prepared_regex = {} self.files_readed = [] self.source = self.conf.get("detection", "source") self.prepa...
en
0.385269
# replace special fail2ban variable # fix broken regex
2.750099
3
Beginning/python3_cookbook/ch02/16-textwrap.py
XiangyuDing/Beginning-Python
1
6627393
<reponame>XiangyuDing/Beginning-Python<filename>Beginning/python3_cookbook/ch02/16-textwrap.py # 2.16 以指定列宽格式化字符串 s = "Look into my eyes, look into my eyes, the eyes, the eyes, \ the eyes, not around the eyes, don't look around the eyes, \ look into my eyes, you're under." import textwrap print(textwrap.fill(s,70)) p...
# 2.16 以指定列宽格式化字符串 s = "Look into my eyes, look into my eyes, the eyes, the eyes, \ the eyes, not around the eyes, don't look around the eyes, \ look into my eyes, you're under." import textwrap print(textwrap.fill(s,70)) print(textwrap.fill(s,40)) print(textwrap.fill(s,40,initial_indent=' ')) print(textwrap.fill(s...
en
0.111133
# 2.16 以指定列宽格式化字符串 # print(os.get_terminal_size().columns) doens't work
3.652016
4
garageofcode/pizza/main.py
tpi12jwe/garageofcode
2
6627394
<reponame>tpi12jwe/garageofcode<gh_stars>1-10 import numpy as np import time import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from garageofcode.common.utils import flatten_simple as flatten from garageofcode.common.utils import get_fn from garageofcode.common.interval_utils import get_corners2,...
import numpy as np import time import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from garageofcode.common.utils import flatten_simple as flatten from garageofcode.common.utils import get_fn from garageofcode.common.interval_utils import get_corners2, interval_overlap2 from garageofcode.sat.assig...
en
0.347802
#print("Mat time: {0:.3f}".format(t1 - t0)) #print("Mat score:", score) #print(coords) #draw_solution(mat, coords) #print(row, ":") #print("Row time: {0:.3f}".format(t1 - t0)) #score = sum([j - i + 1 for i, j in coords], 0) #for i, j in coords: # print("\t", row[i:j+1]) #print("Row score:", sum([j - i + 1 for i, j i...
2.846455
3
apps/taiga/back/django/gunicorn_config.py
stephenhillier/openshift-components
9
6627395
worker_class = 'gevent'
worker_class = 'gevent'
none
1
1.057154
1
liikkuja.py
UrsaOK/supertassu
0
6627396
from merkki import Sprite class Liikkuja(Sprite): def __init__(self, x, y, merkki, taso): print("liikkuja init") super(Liikkuja, self).__init__(x, y, merkki) self.taso = taso def liiku(self, suunta): print("liikkuja liiku") uusix = self.x + suunta[0] uusiy = sel...
from merkki import Sprite class Liikkuja(Sprite): def __init__(self, x, y, merkki, taso): print("liikkuja init") super(Liikkuja, self).__init__(x, y, merkki) self.taso = taso def liiku(self, suunta): print("liikkuja liiku") uusix = self.x + suunta[0] uusiy = sel...
none
1
2.873711
3
octodns/source/tinydns.py
Smallcubed/octodns
3
6627397
<gh_stars>1-10 # # # from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import defaultdict from ipaddress import ip_address from os import listdir from os.path import join import logging import re import textwrap from ..record import Record from ..zone import Du...
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import defaultdict from ipaddress import ip_address from os import listdir from os.path import join import logging import re import textwrap from ..record import Record from ..zone import DuplicateRecordEx...
en
0.841079
# # # # TinyDNS files have the ipv6 address written in full, but with the # colons removed. This inserts a colon every 4th character to make # the address correct. # Something we don't care about # Skip type, remove trailing comments, and omit newline # Split on :'s including :: and strip leading/trailing ws # We're on...
2.164448
2
release/stubs.min/Rhino/DocObjects/__init___parts/AnnotationObjectBase.py
YKato521/ironpython-stubs
0
6627398
<reponame>YKato521/ironpython-stubs<filename>release/stubs.min/Rhino/DocObjects/__init___parts/AnnotationObjectBase.py class AnnotationObjectBase(RhinoObject): """ Provides a base class for Rhino.Geometry.AnnotationBase-derived objects that are placed in a document. """ DisplayText = property( ...
class AnnotationObjectBase(RhinoObject): """ Provides a base class for Rhino.Geometry.AnnotationBase-derived objects that are placed in a document. """ DisplayText = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets the text that is displayed to...
en
0.759412
Provides a base class for Rhino.Geometry.AnnotationBase-derived objects that are placed in a document. Gets the text that is displayed to users. Get: DisplayText(self: AnnotationObjectBase) -> str
2.2669
2
scheduler.py
zkogan/wittify
1
6627399
import schedule, subprocess, time, sys, os, time date_folder = time.strftime("%d%m%Y") output = date_folder + "/" + "output.txt" if not os.path.isdir(date_folder): os.mkdir(date_folder) if not os.path.isfile(output): f = open(output,"w+") def job (output, date): print("Running the transcribe...
import schedule, subprocess, time, sys, os, time date_folder = time.strftime("%d%m%Y") output = date_folder + "/" + "output.txt" if not os.path.isdir(date_folder): os.mkdir(date_folder) if not os.path.isfile(output): f = open(output,"w+") def job (output, date): print("Running the transcribe...
none
1
2.709435
3
src/day008.py
zhangxinyong12/my-python-demo
0
6627400
<reponame>zhangxinyong12/my-python-demo # class Person: # def __init__(self, name, age): # self.name = name # self.age = age # # def eat(self, foot): # print(self.name + "正在吃" + foot) # # # lilei = Person('lilei', 18) # lilei.eat('苹果') # # # # # # class Cat: # type = '猫' # # def ...
# class Person: # def __init__(self, name, age): # self.name = name # self.age = age # # def eat(self, foot): # print(self.name + "正在吃" + foot) # # # lilei = Person('lilei', 18) # lilei.eat('苹果') # # # # # # class Cat: # type = '猫' # # def __init__(self, name, age, color): # ...
en
0.233
# class Person: # def __init__(self, name, age): # self.name = name # self.age = age # # def eat(self, foot): # print(self.name + "正在吃" + foot) # # # lilei = Person('lilei', 18) # lilei.eat('苹果') # # # # # # class Cat: # type = '猫' # # def __init__(self, name, age, color): # ...
3.825549
4
ecommerceweb/dbmodel.py
ShreyaDhananjay/EcommerceWebsite
9
6627401
<gh_stars>1-10 from ecommerceweb import db, login_manager from datetime import datetime from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from ecommerceweb import db, login_manager, app from flask_login import UserMixin @login_manager.user_loader def load_user(user_id): return User.query.get(...
from ecommerceweb import db, login_manager from datetime import datetime from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from ecommerceweb import db, login_manager, app from flask_login import UserMixin @login_manager.user_loader def load_user(user_id): return User.query.get(int(user_id)) ...
none
1
2.326946
2
backend/config.py
edmondjt/python-blockchain
0
6627402
NANOSECONDS = 1 MICROSECONDS = 1000 * NANOSECONDS MILLISECONDS = 1000 * MICROSECONDS SECONDS = 1000 * MILLISECONDS MINE_RATE = 4 * SECONDS STARTING_BALANCE = 1000 MINING_REWARD = 50 MINING_REWARD_INPUT = { 'address': '*--approved-mining-reward--*' }
NANOSECONDS = 1 MICROSECONDS = 1000 * NANOSECONDS MILLISECONDS = 1000 * MICROSECONDS SECONDS = 1000 * MILLISECONDS MINE_RATE = 4 * SECONDS STARTING_BALANCE = 1000 MINING_REWARD = 50 MINING_REWARD_INPUT = { 'address': '*--approved-mining-reward--*' }
none
1
1.736815
2
setup.py
asuiu/idzip
1
6627403
#!/usr/bin/python from setuptools import setup, find_packages VERSION = "0.3.6" setup( name = "python-idzip", version = VERSION, packages=find_packages(), entry_points={ "console_scripts": [ "idzip = idzip.command:main" ] }, description = 'DictZip - Rand...
#!/usr/bin/python from setuptools import setup, find_packages VERSION = "0.3.6" setup( name = "python-idzip", version = VERSION, packages=find_packages(), entry_points={ "console_scripts": [ "idzip = idzip.command:main" ] }, description = 'DictZip - Rand...
ru
0.258958
#!/usr/bin/python
1.359643
1
rapidtide/workflows/rapidtide2x_parser.py
tsalo/rapidtide
0
6627404
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-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 # #...
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-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 # #...
en
0.718829
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016-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 # #...
2.036468
2
scripts/calculate_migraine_ancestry_nonphased_sites.py
will-camb/Nero
1
6627405
import pandas as pd import argparse import seaborn as sns import os import sys sns.set(color_codes=True) parser = argparse.ArgumentParser() parser.add_argument("-chr", help="The chromosome", required=True) args = parser.parse_args() mapping = pd.read_csv("rsID-chr_mapping", he...
import pandas as pd import argparse import seaborn as sns import os import sys sns.set(color_codes=True) parser = argparse.ArgumentParser() parser.add_argument("-chr", help="The chromosome", required=True) args = parser.parse_args() mapping = pd.read_csv("rsID-chr_mapping", he...
en
0.984271
# Get closest position in cols, because not # all SNPs were painted # Saved in correct order
2.680058
3
q2_katharoseq/_transformer.py
antgonza/q2-katharoseq
0
6627406
import pandas as pd from .plugin_setup import plugin from ._format import EstimatedBiomassFmt @plugin.register_transformer def _1(data: pd.DataFrame) -> EstimatedBiomassFmt: ff = EstimatedBiomassFmt() data.to_csv(str(ff)) return ff @plugin.register_transformer def _2(ff: EstimatedBiomassFmt) -> pd.Data...
import pandas as pd from .plugin_setup import plugin from ._format import EstimatedBiomassFmt @plugin.register_transformer def _1(data: pd.DataFrame) -> EstimatedBiomassFmt: ff = EstimatedBiomassFmt() data.to_csv(str(ff)) return ff @plugin.register_transformer def _2(ff: EstimatedBiomassFmt) -> pd.Data...
none
1
2.150493
2
models/hyp_alpha_eval.py
gyy8426/R2-Net
0
6627407
<reponame>gyy8426/R2-Net<gh_stars>0 import matplotlib matplotlib.use('Agg') from dataloaders.visual_genome import VGDataLoader, VG import numpy as np import torch from sklearn.metrics import accuracy_score from config import ModelConfig from lib.pytorch_misc import optimistic_restore from lib.evaluation.sg_eval import ...
import matplotlib matplotlib.use('Agg') from dataloaders.visual_genome import VGDataLoader, VG import numpy as np import torch from sklearn.metrics import accuracy_score from config import ModelConfig from lib.pytorch_misc import optimistic_restore from lib.evaluation.sg_eval import BasicSceneGraphEvaluator from tqdm i...
en
0.383737
#size_index = np.load('/home/guoyuyu/code/code_by_myself/scene_graph/dataset_analysis/size_index.npy') #from lib.rel_model_2bias_2_hyp import RelModel #from lib.rel_model_topgcn_hyp import RelModel #from lib.rel_model_rnn2_hyp import RelModel # optimistic_restore(detector.detector, torch.load('checkpoints/vgdet/vg-28.t...
1.89827
2
List.py
sulphatet/Python
28,321
6627408
List = [] # List is Muteable # means value can be change List.insert(0 , 5) List.insert(1,10) List.insert(0,6) print(List) List.remove(6) List.append(9) List.append(1) List.sort() print(List) List.pop() List.reverse() print(List) """ List.append(1) print(List) List.append(2) print(List) List.insert(...
List = [] # List is Muteable # means value can be change List.insert(0 , 5) List.insert(1,10) List.insert(0,6) print(List) List.remove(6) List.append(9) List.append(1) List.sort() print(List) List.pop() List.reverse() print(List) """ List.append(1) print(List) List.append(2) print(List) List.insert(...
en
0.713667
# List is Muteable # means value can be change List.append(1) print(List) List.append(2) print(List) List.insert(1 , 3) print(List) Expected Output: 2 10 12 4
4.006393
4
Libraries/Python/wxGlade/v0.9,5/wxGlade-0.9.5-py3.6.egg/wxglade/widgets/dialog/wconfig.py
davidbrownell/Common_EnvironmentEx
0
6627409
"""\ wxDialog widget configuration @copyright: 2014-2016 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ # keep in sync: wxDialog, wxPanel and wxStaticBitmap config = { 'wxklass': 'wxDialog', 'style_defs': { 'wxDEFAULT_DIALOG_STYLE': { 'desc': 'from wxDialo...
"""\ wxDialog widget configuration @copyright: 2014-2016 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ # keep in sync: wxDialog, wxPanel and wxStaticBitmap config = { 'wxklass': 'wxDialog', 'style_defs': { 'wxDEFAULT_DIALOG_STYLE': { 'desc': 'from wxDialo...
en
0.518856
\ wxDialog widget configuration @copyright: 2014-2016 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY # keep in sync: wxDialog, wxPanel and wxStaticBitmap # generic styles from wxWindow (from common.py): # - wxFULL_REPAINT_ON_RESIZE # - wxNO_FULL_REPAINT_ON_RESIZE # - wxCLIP_CHILDREN
1.856576
2
CRM-Project/config/settings.py
wiky-avis/trainee-domclick-test
0
6627410
import os from pathlib import Path from dotenv import load_dotenv load_dotenv() TELEGRAM_TOKEN = os.getenv('TELEGRAM_TOKEN') CHAT_ID = os.getenv('CHAT_ID') BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = '<KEY>' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'crm', 'accounts', 'c...
import os from pathlib import Path from dotenv import load_dotenv load_dotenv() TELEGRAM_TOKEN = os.getenv('TELEGRAM_TOKEN') CHAT_ID = os.getenv('CHAT_ID') BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = '<KEY>' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'crm', 'accounts', 'c...
none
1
1.717284
2
Find My Things -James- David- and Vaughan/PI GATEWAY/exampleresources.py
kelgazza/CSCE513-Fall2017
0
6627411
import time from coapthon import defines from coapthon.client.helperclient import HelperClient from coapthon.resources.resource import Resource import sensortag __author__ = '<NAME>' class BasicResource(Resource): def __init__(self, name="BasicResource", coap_server=None, rt="observe", fIP="", fPort=None, fPath="...
import time from coapthon import defines from coapthon.client.helperclient import HelperClient from coapthon.resources.resource import Resource import sensortag __author__ = '<NAME>' class BasicResource(Resource): def __init__(self, name="BasicResource", coap_server=None, rt="observe", fIP="", fPort=None, fPath="...
none
1
2.428946
2
app/config/petskill1.py
xiaomi2019/lolita_son
0
6627412
# -*- coding: utf-8 -*- ''' Author: Hannibal Data: Desc: local data config NOTE: Don't modify this file, it's build by xml-to-python!!! ''' petskill1_map = {}; petskill1_map[1] = {"lv":1,"reqlv":1,"gold":20,"exppersec":1,}; petskill1_map[2] = {"lv":2,"reqlv":2,"gold":100,"exppersec":4,}; petskill1_map[3] = {"lv":3,...
# -*- coding: utf-8 -*- ''' Author: Hannibal Data: Desc: local data config NOTE: Don't modify this file, it's build by xml-to-python!!! ''' petskill1_map = {}; petskill1_map[1] = {"lv":1,"reqlv":1,"gold":20,"exppersec":1,}; petskill1_map[2] = {"lv":2,"reqlv":2,"gold":100,"exppersec":4,}; petskill1_map[3] = {"lv":3,...
en
0.776909
# -*- coding: utf-8 -*- Author: Hannibal Data: Desc: local data config NOTE: Don't modify this file, it's build by xml-to-python!!!
1.68984
2
tests/test_multiviewica.py
hugorichard/mvneuro
0
6627413
import os import pytest import numpy as np from mvneuro.multiviewica import MultiViewICA import tempfile def generate_data( n_voxels, n_supervoxels, n_timeframes, n_components, n_subjects, datadir, ): """ Generate data without noise Returns ------ W, Ss, Xs, np.array(paths) W, Ss, Xs "...
import os import pytest import numpy as np from mvneuro.multiviewica import MultiViewICA import tempfile def generate_data( n_voxels, n_supervoxels, n_timeframes, n_components, n_subjects, datadir, ): """ Generate data without noise Returns ------ W, Ss, Xs, np.array(paths) W, Ss, Xs "...
en
0.843617
Generate data without noise Returns ------ W, Ss, Xs, np.array(paths) W, Ss, Xs Check that we recover same subject specific sources Check that we recover same subject specific sources Test that we can recover data after transform Test that we can recover data after transform Test that we can recover dat...
2.001942
2
tests/config_tests/test_sample_config.py
AltaverseDAO/bittensor
0
6627414
import os, sys from bittensor._neuron.text.template_miner import neuron as template_miner from bittensor._neuron.text.core_validator import neuron as core_validator from bittensor._neuron.text.template_server import server as template_server from bittensor._neuron.text.advanced_server import server as advanced_server ...
import os, sys from bittensor._neuron.text.template_miner import neuron as template_miner from bittensor._neuron.text.core_validator import neuron as core_validator from bittensor._neuron.text.template_server import server as template_server from bittensor._neuron.text.advanced_server import server as advanced_server ...
none
1
1.927081
2
sandbox/rocky/tf/core/parameterized.py
windweller/nlplab
0
6627415
<reponame>windweller/nlplab<gh_stars>0 from contextlib import contextmanager from rllab.core.serializable import Serializable from rllab.misc.tensor_utils import flatten_tensors, unflatten_tensors import tensorflow as tf import numpy as np import h5py import os import time load_params = True @contextmanager def sup...
from contextlib import contextmanager from rllab.core.serializable import Serializable from rllab.misc.tensor_utils import flatten_tensors, unflatten_tensors import tensorflow as tf import numpy as np import h5py import os import time load_params = True @contextmanager def suppress_params_loading(): global load...
en
0.519884
Internal method to be implemented which does not perform caching Get the list of parameters, filtered by the provided tags. Some common tags include 'regularizable' and 'trainable' # only return unique parameters # create log_dir if non-existent # create log_dir if non-existent
2.210729
2
sprint-1/python/string.py
pradeepwaviz/Aviral
0
6627416
string=input("Enter any String: ") for char in string: print(char)
string=input("Enter any String: ") for char in string: print(char)
none
1
3.953594
4
iirsBenchmark/explainers/_base_explainer.py
gAldeia/iirsBenchmark
0
6627417
<gh_stars>0 # Author: <NAME> # Contact: <EMAIL> # Version: 1.0.0 # Last modified: 08-20-2021 by <NAME> from sklearn.exceptions import NotFittedError from sklearn.utils import check_X_y import numpy as np """ Base explainer, should be inherited by all explainers. The base explainer has the following attr...
# Author: <NAME> # Contact: <EMAIL> # Version: 1.0.0 # Last modified: 08-20-2021 by <NAME> from sklearn.exceptions import NotFittedError from sklearn.utils import check_X_y import numpy as np """ Base explainer, should be inherited by all explainers. The base explainer has the following attributes: * `...
en
0.78377
# Author: <NAME> # Contact: <EMAIL> # Version: 1.0.0 # Last modified: 08-20-2021 by <NAME> Base explainer, should be inherited by all explainers. The base explainer has the following attributes: * `agnostic` : attribute indicating if the explainer is model agnostic or not. If it is, then agnostic=True, else a...
2.830551
3
FRG Hardware/frghardware/wardmapper/frghardware/wardmapper/__init__.py
fenning-research-group/Instruments
0
6627418
# from .mapper import * # from .stage import stage # from .mono import mono # from .daq import daq
# from .mapper import * # from .stage import stage # from .mono import mono # from .daq import daq
en
0.658561
# from .mapper import * # from .stage import stage # from .mono import mono # from .daq import daq
0.972896
1
tests/test_spec.py
shanty-social/parcel
0
6627419
<filename>tests/test_spec.py from unittest import TestCase from parameterized import parameterized from parcel.spec import Spec class SpecTestCase(TestCase): @parameterized.expand([ ('foobar=1.0', 'foobar=1.0.0'), ('foobar>=1.0', 'foobar=1.0'), ('foobar>=1.0', 'foobar=2.0'), ('fo...
<filename>tests/test_spec.py from unittest import TestCase from parameterized import parameterized from parcel.spec import Spec class SpecTestCase(TestCase): @parameterized.expand([ ('foobar=1.0', 'foobar=1.0.0'), ('foobar>=1.0', 'foobar=1.0'), ('foobar>=1.0', 'foobar=2.0'), ('fo...
none
1
2.809838
3
guild/plugins/dvc_stage_main.py
msarahan/guildai
0
6627420
<filename>guild/plugins/dvc_stage_main.py # Copyright 2017-2022 TensorHub, 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 requi...
<filename>guild/plugins/dvc_stage_main.py # Copyright 2017-2022 TensorHub, 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 requi...
en
0.839864
# Copyright 2017-2022 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
2.04881
2
weighted_average.py
yixinxu2020/kaggle-aptos2019-blindness-detection
40
6627421
<filename>weighted_average.py<gh_stars>10-100 import pandas as pd def main(): probs = {} probs['se_resnext50_32x4d'] = pd.read_csv('probs/se_resnext50_32x4d_080922.csv')['diagnosis'].values probs['se_resnext101_32x4d'] = pd.read_csv('probs/se_resnext101_32x4d_081208.csv')['diagnosis'].values probs['se...
<filename>weighted_average.py<gh_stars>10-100 import pandas as pd def main(): probs = {} probs['se_resnext50_32x4d'] = pd.read_csv('probs/se_resnext50_32x4d_080922.csv')['diagnosis'].values probs['se_resnext101_32x4d'] = pd.read_csv('probs/se_resnext101_32x4d_081208.csv')['diagnosis'].values probs['se...
none
1
2.785305
3
simqle/constants.py
Harlekuin/SimQLe
37
6627422
"""Load Constants.""" from os.path import expanduser, join DEV_MAP = { "production": "connections", "development": "dev-connections", "testing": "test-connections", } DEFAULT_FILE_LOCATIONS = [ "./.connections.yaml", # the home folder on either Linux or Windows join(expanduser("~"), ".connect...
"""Load Constants.""" from os.path import expanduser, join DEV_MAP = { "production": "connections", "development": "dev-connections", "testing": "test-connections", } DEFAULT_FILE_LOCATIONS = [ "./.connections.yaml", # the home folder on either Linux or Windows join(expanduser("~"), ".connect...
en
0.647826
Load Constants. # the home folder on either Linux or Windows
1.659347
2
conu/helpers/docker_backend.py
lslebodn/conu
95
6627423
from conu import DockerRunBuilder def get_container_output(backend, image_name, command, image_tag="latest", additional_opts=None): """ Create a throw-away container based on provided image and tag, run the supplied command in it and return output. The container is stopped and rem...
from conu import DockerRunBuilder def get_container_output(backend, image_name, command, image_tag="latest", additional_opts=None): """ Create a throw-away container based on provided image and tag, run the supplied command in it and return output. The container is stopped and rem...
en
0.772664
Create a throw-away container based on provided image and tag, run the supplied command in it and return output. The container is stopped and removed after it exits. :param backend: instance of DockerBackend :param image_name: str, name of the container image :param command: list of str, command to run...
3.145793
3
setup.py
radovankavicky/pymaclab
1
6627424
#!/usr/bin/env python import os import sys import shutil import glob loco = sys.argv[0] loco = loco.split('setup.py')[0] # Read the requirements file filo = open(os.path.join(loco,'requirements.txt'),'r') lines = filo.readlines() filo.close() reqli = [] for lino in lines: if '=' in lino: packname = lino.sp...
#!/usr/bin/env python import os import sys import shutil import glob loco = sys.argv[0] loco = loco.split('setup.py')[0] # Read the requirements file filo = open(os.path.join(loco,'requirements.txt'),'r') lines = filo.readlines() filo.close() reqli = [] for lino in lines: if '=' in lino: packname = lino.sp...
en
0.804239
#!/usr/bin/env python # Read the requirements file ###################################################################### # Check dependencies and install using pip ###################################################################### # Now check for numpy and install if needed # Now check for scipy and install if nee...
2.481898
2
xgds_image/models.py
xgds/xgds_image
1
6627425
#__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance ...
#__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance ...
en
0.83404
#__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance ...
1.354162
1
lndmanage/grpc_compiled/router_pb2_grpc.py
mmilata/lndmanage
0
6627426
<reponame>mmilata/lndmanage<filename>lndmanage/grpc_compiled/router_pb2_grpc.py # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import lndmanage.grpc_compiled.router_pb2 as router__pb2 import lndmanage.grpc_compiled.rpc_pb2 as rpc__pb2 class RouterStub(object): # missing associate...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import lndmanage.grpc_compiled.router_pb2 as router__pb2 import lndmanage.grpc_compiled.rpc_pb2 as rpc__pb2 class RouterStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): ...
en
0.833612
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! # missing associated documentation comment in .proto file Constructor. Args: channel: A grpc.Channel. # missing associated documentation comment in .proto file * SendPaymentV2 attempts to route a payment described by the passed Pay...
1.960116
2
tests/external_boto3/test_boto3_iam.py
newrelic/newrelic-python-agen
92
6627427
# Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
en
0.870379
# Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
1.599962
2
opennem/core/compat/loader.py
paulculmsee/opennem
22
6627428
<filename>opennem/core/compat/loader.py """ OpenNEM v2 schema loader """ import logging from datetime import timedelta from typing import Dict, List, Optional from opennem.api.export.map import StatType from opennem.core.compat.schema import OpennemDataSetV2, OpennemDataV2 from opennem.diff.versions import get_v2_url ...
<filename>opennem/core/compat/loader.py """ OpenNEM v2 schema loader """ import logging from datetime import timedelta from typing import Dict, List, Optional from opennem.api.export.map import StatType from opennem.core.compat.schema import OpennemDataSetV2, OpennemDataV2 from opennem.diff.versions import get_v2_url ...
en
0.397879
OpenNEM v2 schema loader Patch fix for today()
2.240226
2
register_to_template_flirt.py
gsanroma/nimg-scripts
2
6627429
<reponame>gsanroma/nimg-scripts import argparse import os import sys parser = argparse.ArgumentParser(description='Registers images to template. Can use initial transformation.') parser.add_argument("--mov_dir", type=str, nargs=1, required=True, help='directory input images') parser.add_argument("--mov_suffix", type=s...
import argparse import os import sys parser = argparse.ArgumentParser(description='Registers images to template. Can use initial transformation.') parser.add_argument("--mov_dir", type=str, nargs=1, required=True, help='directory input images') parser.add_argument("--mov_suffix", type=str, nargs=1, required=True, help...
en
0.070367
# args = parser.parse_args('' # '--mov_dir /home/sanromag/DATA/WMH/test_flirt2mni ' # '--mov_suffix _t95.nii.gz ' # '--template_file /home/sanromag/DATA/WMH/template/MNI152_T1_1mm_brain.nii.gz ' # '--out_dir /home/sanrom...
2.558267
3
pySPACE/tests/__init__.py
pyspace/pyspace
32
6627430
<gh_stars>10-100 """ Collection of pySPACE system and unit tests .. note:: The section with :mod:`~pySPACE.tests` is not really complete, but there is a script to run all unittests automatically. """ import logging # create logger for test output logger = logging.getLogger('TestLogger') logger.setLevel(loggin...
""" Collection of pySPACE system and unit tests .. note:: The section with :mod:`~pySPACE.tests` is not really complete, but there is a script to run all unittests automatically. """ import logging # create logger for test output logger = logging.getLogger('TestLogger') logger.setLevel(logging.DEBUG) logging...
en
0.823232
Collection of pySPACE system and unit tests .. note:: The section with :mod:`~pySPACE.tests` is not really complete, but there is a script to run all unittests automatically. # create logger for test output
2.502155
3
src/external/elf-loader/test/testjunit.py
cclauss/shadow
1
6627431
<gh_stars>1-10 #! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- import sys import os import subprocess import junit_xml_output test_cases = [] for arg in sys.argv[1:]: if '12' in arg: val = subprocess.Popen(['rm' ,'-f', 'libl.so']) val.wait...
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- import sys import os import subprocess import junit_xml_output test_cases = [] for arg in sys.argv[1:]: if '12' in arg: val = subprocess.Popen(['rm' ,'-f', 'libl.so']) val.wait () cmd = ...
en
0.336369
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- #print stdout #print stderr
2.083971
2
eval.py
tcl9876/Denoising_Student
4
6627432
<filename>eval.py from imageio import imwrite import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tqdm import tqdm import os from utils import show_images, slerp, make_batch_of_images, float_to_image, load_models_from_gdrive from models import Onestep_Model #note: these functions do NOT sup...
<filename>eval.py from imageio import imwrite import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tqdm import tqdm import os from utils import show_images, slerp, make_batch_of_images, float_to_image, load_models_from_gdrive from models import Onestep_Model #note: these functions do NOT sup...
en
0.843367
#note: these functions do NOT support multi-gpu or TPU. Will either run on one GPU if available, otherwise CPU this function can be used to write 50k images for metrics (IS and FID) metrics are each calculated against 50k training images from cifar10 and (FID only) celeba. both IS and FID use the official code ...
2.069199
2
src/pyrogue/color.py
whilb/roguelike
0
6627433
import curses def main(stdscr): curses.start_color() curses.use_default_colors() for i in range(0, curses.COLORS): curses.init_pair(i + 1, i, -1) try: for i in range(0, 255): stdscr.addstr(str(i), curses.color_pair(i)) except curses.ERR: # End of screen reached ...
import curses def main(stdscr): curses.start_color() curses.use_default_colors() for i in range(0, curses.COLORS): curses.init_pair(i + 1, i, -1) try: for i in range(0, 255): stdscr.addstr(str(i), curses.color_pair(i)) except curses.ERR: # End of screen reached ...
en
0.968511
# End of screen reached
3.006747
3
datastructure/practice/c3/r_3_1.py
stoneyangxu/python-kata
0
6627434
import matplotlib.pyplot as plt import math def f_8n(n): return 8 * n def f_4nlogn(n): return 4 * n * math.log2(n) def f_2n2(n): return 2 * (n ** 2) def f_n3(n): return n ** 3 def f_2n(n): return 2 ** n if __name__ == '__main__': seq_8n = [] seq_4nlogn = [] seq_2n2 = [] s...
import matplotlib.pyplot as plt import math def f_8n(n): return 8 * n def f_4nlogn(n): return 4 * n * math.log2(n) def f_2n2(n): return 2 * (n ** 2) def f_n3(n): return n ** 3 def f_2n(n): return 2 ** n if __name__ == '__main__': seq_8n = [] seq_4nlogn = [] seq_2n2 = [] s...
none
1
2.981225
3
Basic Programs/tut_44.py
Ahtisham-Shakir/Python_Basics
0
6627435
<gh_stars>0 l1 = ["Bhindi", "Aloo", "chopsticks", "chowmein"] # i = 1 # for item in l1: # if i%2 is not 0: # print(f"Jarvis please buy {item}") # i += 1 # Enumerate function return index and item of the list for index, item in enumerate(l1): if index % 2 == 0: print(f"Jarvis please buy {it...
l1 = ["Bhindi", "Aloo", "chopsticks", "chowmein"] # i = 1 # for item in l1: # if i%2 is not 0: # print(f"Jarvis please buy {item}") # i += 1 # Enumerate function return index and item of the list for index, item in enumerate(l1): if index % 2 == 0: print(f"Jarvis please buy {item}")
en
0.601214
# i = 1 # for item in l1: # if i%2 is not 0: # print(f"Jarvis please buy {item}") # i += 1 # Enumerate function return index and item of the list
3.779583
4
libs/GoodOvernight.py
bioinformagic/monica
7
6627436
<reponame>bioinformagic/monica import subprocess import os import xml.etree.ElementTree as parXML import wget from src.piper_pan import shell_runner # TODO add documentation to your code! class GoodOvernight(): def __init__(self): pass def unmapped_extractor(self, exp_output, unmapped_path): # this c...
import subprocess import os import xml.etree.ElementTree as parXML import wget from src.piper_pan import shell_runner # TODO add documentation to your code! class GoodOvernight(): def __init__(self): pass def unmapped_extractor(self, exp_output, unmapped_path): # this creates fasta files over unmappe...
en
0.70098
# TODO add documentation to your code! # this creates fasta files over unmapped bam sequences #This line of code downloads from db2db a xml file with a specific filename #that is biodbnetRestApi.xml # this line initializes the xml file so to be parsed # the previous for loop for every level so 'Gene' we may have 1 or ...
2.732865
3
pypytorch/functions/basic/mm.py
dark-ai/pypytorch
10
6627437
<filename>pypytorch/functions/basic/mm.py # -*- coding: utf-8 -*- from pypytorch.functions.function import Function class MM(Function): """ Notes ----- Matmul doesn't have broadcast problem """ def forward(self, a, b): return a @ b def backward_0(self, grad): a, b =...
<filename>pypytorch/functions/basic/mm.py # -*- coding: utf-8 -*- from pypytorch.functions.function import Function class MM(Function): """ Notes ----- Matmul doesn't have broadcast problem """ def forward(self, a, b): return a @ b def backward_0(self, grad): a, b =...
en
0.951832
# -*- coding: utf-8 -*- Notes ----- Matmul doesn't have broadcast problem
3.240767
3
recombinator/var_info.py
tomsasani/recombinator
0
6627438
from __future__ import absolute_import, print_function import sys import toolshed as ts from .denovo import variant_info from peddy import Ped from cyvcf2 import VCF def main(argv): import argparse p = argparse.ArgumentParser() p.add_argument("bed", help="bed file of variants for which to extract info") ...
from __future__ import absolute_import, print_function import sys import toolshed as ts from .denovo import variant_info from peddy import Ped from cyvcf2 import VCF def main(argv): import argparse p = argparse.ArgumentParser() p.add_argument("bed", help="bed file of variants for which to extract info") ...
none
1
2.119692
2
strict-backup.py
sliwy/backup
0
6627439
<filename>strict-backup.py # Author: <NAME> <<EMAIL>> # # MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # 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 without restriction, including ...
<filename>strict-backup.py # Author: <NAME> <<EMAIL>> # # MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # 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 without restriction, including ...
en
0.751536
# Author: <NAME> <<EMAIL>> # # MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # 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 without restriction, including without limitation the righ...
2.22902
2
perma_web/perma/migrations/0006_add_internetarchive_status.py
rachelaus/perma
317
6627440
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.db.models import Q def update_upload_to_ia_field(apps, schema_editor): Link = apps.get_model('perma', 'Link') Link.objects.filter(uploaded_to_internet_archive=True).update(internet_archive_upl...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.db.models import Q def update_upload_to_ia_field(apps, schema_editor): Link = apps.get_model('perma', 'Link') Link.objects.filter(uploaded_to_internet_archive=True).update(internet_archive_upl...
en
0.769321
# -*- coding: utf-8 -*-
1.896424
2
src/Zope2/App/tests/test_schema.py
rbanffy/Zope
289
6627441
<filename>src/Zope2/App/tests/test_schema.py<gh_stars>100-1000 ############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should...
<filename>src/Zope2/App/tests/test_schema.py<gh_stars>100-1000 ############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should...
en
0.330381
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # # 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. # THIS SOFTWARE IS PROVIDED "AS I...
1.798296
2
Web/datafunctions.py
NielsVanM/BD-HotelReviewVisualizer
0
6627442
from DataLoader.apps import _Mongo from bson.code import Code from datetime import datetime ReviewDB = _Mongo.full_reviews TinyReviewDB = _Mongo.tiny_reviews _argToFieldMap = { "hotelnames": "Hotel_Name" } def _processArgs(request, keys): filterQuery = {} for key in keys: val = request.GET.get(k...
from DataLoader.apps import _Mongo from bson.code import Code from datetime import datetime ReviewDB = _Mongo.full_reviews TinyReviewDB = _Mongo.tiny_reviews _argToFieldMap = { "hotelnames": "Hotel_Name" } def _processArgs(request, keys): filterQuery = {} for key in keys: val = request.GET.get(k...
en
0.120925
function() { emit(this.Review_Date, 1) } function(key, values) { var total = 0 for (var i = 0; i < values.length; i++) { total += values[i] } return total } function() { emit(this.Reviewer_Nationality, 2) ...
2.471338
2
casinotools/fileformat/casino2/ElementIntensity.py
drix00/pycasinotools
2
6627443
#!/usr/bin/env python """ """ # Script information for the file. __author__ = "<NAME> (<EMAIL>)" __version__ = "" __date__ = "" __copyright__ = "Copyright (c) 2009 <NAME>" __license__ = "" # Standard library modules. # Third party modules. # Local modules. import casinotools.fileformat.FileReaderWriterTools as File...
#!/usr/bin/env python """ """ # Script information for the file. __author__ = "<NAME> (<EMAIL>)" __version__ = "" __date__ = "" __copyright__ = "Copyright (c) 2009 <NAME>" __license__ = "" # Standard library modules. # Third party modules. # Local modules. import casinotools.fileformat.FileReaderWriterTools as File...
en
0.445092
#!/usr/bin/env python # Script information for the file. # Standard library modules. # Third party modules. # Local modules. # Globals and constants variables.
2.225429
2
code_11_subtraction.py
aianaconda/pytorch-GNN-1st
6
6627444
<filename>code_11_subtraction.py # -*- coding: utf-8 -*- """ @author: 代码医生工作室 @公众号:xiangyuejiqiren (内有更多优秀文章及学习资料) @来源: <PyTorch深度学习和图神经网络(卷 1)——基础知识>配套代码 @配套代码技术支持:bbs.aianaconda.com Created on Thu Mar 30 09:43:58 2017 """ import copy, numpy as np np.random.seed(0) #随机数生成器的种子,可以每次得到一样的值 # compute sigm...
<filename>code_11_subtraction.py # -*- coding: utf-8 -*- """ @author: 代码医生工作室 @公众号:xiangyuejiqiren (内有更多优秀文章及学习资料) @来源: <PyTorch深度学习和图神经网络(卷 1)——基础知识>配套代码 @配套代码技术支持:bbs.aianaconda.com Created on Thu Mar 30 09:43:58 2017 """ import copy, numpy as np np.random.seed(0) #随机数生成器的种子,可以每次得到一样的值 # compute sigm...
zh
0.856066
# -*- coding: utf-8 -*- @author: 代码医生工作室 @公众号:xiangyuejiqiren (内有更多优秀文章及学习资料) @来源: <PyTorch深度学习和图神经网络(卷 1)——基础知识>配套代码 @配套代码技术支持:bbs.aianaconda.com Created on Thu Mar 30 09:43:58 2017 #随机数生成器的种子,可以每次得到一样的值 # compute sigmoid nonlinearity #激活函数 # convert output of sigmoid function to its derivative #激活函数的导数 #整数到其...
3.362066
3
models/generation_model.py
AIprogrammer/Detailed-virtual-try-on
160
6627445
import numpy as np import torch import os from .base_model import BaseModel from models.networks import Define_G, Define_D from utils.transforms import create_part import torch.nn.functional as F from utils import pose_utils from lib.geometric_matching_multi_gpu import GMM from .base_model import BaseModel from time im...
import numpy as np import torch import os from .base_model import BaseModel from models.networks import Define_G, Define_D from utils.transforms import create_part import torch.nn.functional as F from utils import pose_utils from lib.geometric_matching_multi_gpu import GMM from .base_model import BaseModel from time im...
en
0.608556
# resume of networks # define network # load networks # define optimizer # preprocess warped image from gmm model # target warped cloth # decode labels cost much time #array # opt.joint # self.generated_parsing_face = generated_parsing_c # setattr(self, 'input', getattr(self, 'input_' + self.train_mode)) ###residual le...
1.988943
2
wikipendium/wiki/forms.py
iver56/wikipendium.no
0
6627446
<reponame>iver56/wikipendium.no<gh_stars>0 from django.forms import ModelForm, ValidationError import django.forms as forms from django.core.exceptions import ObjectDoesNotExist from wikipendium.wiki.models import Article, ArticleContent from wikipendium.wiki.merge3 import MergeError, merge from wikipendium.wiki.langco...
from django.forms import ModelForm, ValidationError import django.forms as forms from django.core.exceptions import ObjectDoesNotExist from wikipendium.wiki.models import Article, ArticleContent from wikipendium.wiki.merge3 import MergeError, merge from wikipendium.wiki.langcodes import LANGUAGE_NAMES from re import ma...
none
1
2.220645
2
pywren_ibm_cloud/compute/backends/docker/config.py
tomwhite/pywren-ibm-cloud
1
6627447
import sys import multiprocessing from pywren_ibm_cloud.utils import version_str RUNTIME_DEFAULT_35 = 'pywren-docker-runtime-v3.5:latest' RUNTIME_DEFAULT_36 = 'pywren-docker-runtime-v3.6:latest' RUNTIME_DEFAULT_37 = 'pywren-docker-runtime-v3.7:latest' RUNTIME_TIMEOUT_DEFAULT = 600 # 10 minutes RUNTIME_MEMORY_DEFAULT ...
import sys import multiprocessing from pywren_ibm_cloud.utils import version_str RUNTIME_DEFAULT_35 = 'pywren-docker-runtime-v3.5:latest' RUNTIME_DEFAULT_36 = 'pywren-docker-runtime-v3.6:latest' RUNTIME_DEFAULT_37 = 'pywren-docker-runtime-v3.7:latest' RUNTIME_TIMEOUT_DEFAULT = 600 # 10 minutes RUNTIME_MEMORY_DEFAULT ...
en
0.312297
# 10 minutes # 256 MB RUN apt-get update && apt-get install -y \ git RUN pip install --upgrade pip setuptools six \ && pip install --no-cache-dir \ pika==0.13.1 \ ibm-cos-sdk \ redis \ requests \ numpy # Copy PyWren app to the container image. ENV APP_HOME /pywren W...
1.985335
2
LwF_Decentralized_Same/PLN_Class.py
anubhabghosh/EQ2443-5
0
6627448
<filename>LwF_Decentralized_Same/PLN_Class.py ######################################################################## # Project Name: Decentralised Deep Learning without Forgetting # Creators: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # Project Owners: <NA...
<filename>LwF_Decentralized_Same/PLN_Class.py ######################################################################## # Project Name: Decentralised Deep Learning without Forgetting # Creators: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # Project Owners: <NA...
en
0.59899
######################################################################## # Project Name: Decentralised Deep Learning without Forgetting # Creators: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # Project Owners: <NAME> (<EMAIL>), # <NAME> (<EMAIL>...
2.61848
3
obspost/migrations/0003_auto_20160825_0710.py
pankajlal/prabandh
0
6627449
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-25 01:40 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('obspost', '0002_childsheet'...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-25 01:40 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('obspost', '0002_childsheet'...
en
0.758423
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-25 01:40
1.525146
2
rx/core/observable/generatewithrelativetime.py
daliclass/RxPY
0
6627450
<reponame>daliclass/RxPY from rx.core import Observable from rx.concurrency import timeout_scheduler from rx.disposable import MultipleAssignmentDisposable def _generate_with_relative_time(initial_state, condition, iterate, time_mapper) -> Observable: """Generates an observable sequence by iterating a state from ...
from rx.core import Observable from rx.concurrency import timeout_scheduler from rx.disposable import MultipleAssignmentDisposable def _generate_with_relative_time(initial_state, condition, iterate, time_mapper) -> Observable: """Generates an observable sequence by iterating a state from an initial state unti...
en
0.697699
Generates an observable sequence by iterating a state from an initial state until the condition fails. Example: res = source.generate_with_relative_time(0, lambda x: True, lambda x: x + 1, lambda x: 0.5) Args: initial_state: Initial state. condition: Condition to terminate generati...
2.901069
3