max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
src/aosat/fftx.py | mfeldt/AOSAT | 2 | 6623151 | <filename>src/aosat/fftx.py
# -*- coding: utf-8 -*-
"""
This selects the best (i.e. fastest) FFT routine to be used in AOSAT.
The module will look first for CUDA, then for OpenCL, and fall back
to numpy FFTs if neither is available.
"""
import logging
log = logging.getLogger('aosat_logger')
log.addHandler(logging.Nu... | <filename>src/aosat/fftx.py
# -*- coding: utf-8 -*-
"""
This selects the best (i.e. fastest) FFT routine to be used in AOSAT.
The module will look first for CUDA, then for OpenCL, and fall back
to numpy FFTs if neither is available.
"""
import logging
log = logging.getLogger('aosat_logger')
log.addHandler(logging.Nu... | en | 0.586954 | # -*- coding: utf-8 -*- This selects the best (i.e. fastest) FFT routine to be used in AOSAT. The module will look first for CUDA, then for OpenCL, and fall back to numpy FFTs if neither is available. ## ## ## Check for GPU support and select FFT function ## ## #import numpy as np ## ## use numpy fftx ## Make a plan f... | 2.235471 | 2 |
src/data.py | nikikilbertus/general-iv-models | 9 | 6623152 | <filename>src/data.py
"""Data loading and pre-processing utilities."""
from typing import Tuple, Callable, Sequence, Text, Dict, Union
import os
from absl import logging
import jax.numpy as np
from jax import random
import numpy as onp
import pandas as pd
from scipy.stats import norm
import utils
DataSynth = Tu... | <filename>src/data.py
"""Data loading and pre-processing utilities."""
from typing import Tuple, Callable, Sequence, Text, Dict, Union
import os
from absl import logging
import jax.numpy as np
from jax import random
import numpy as onp
import pandas as pd
from scipy.stats import norm
import utils
DataSynth = Tu... | en | 0.696818 | Data loading and pre-processing utilities. # ============================================================================= # NOISE SOURCES # ============================================================================= Generate a Gaussian for the confounder. Generate a multivariate Gaussian for the noises e_X, e_Y. # =... | 2.752634 | 3 |
Interact with the API/get-blobs.py | KevoLoyal/youngrockets | 0 | 6623153 | ########### Blob Interaction ###########
import http.client, urllib.request, urllib.parse, urllib.error, base64, requests, json
# Get all modules for the Blob Storage
from azure.storage.blob import BlockBlobService
from azure.storage.blob import PublicAccess
from azure.storage.blob import ContentSettings
from... | ########### Blob Interaction ###########
import http.client, urllib.request, urllib.parse, urllib.error, base64, requests, json
# Get all modules for the Blob Storage
from azure.storage.blob import BlockBlobService
from azure.storage.blob import PublicAccess
from azure.storage.blob import ContentSettings
from... | en | 0.674102 | ########### Blob Interaction ########### # Get all modules for the Blob Storage # Import OS Path Function # Python Classes Involved # BlobServiceClient: The BlobServiceClient class allows you to manipulate Azure Storage resources and blob containers. # ContainerClient: The ContainerClient class allows you to manipulate... | 3.033523 | 3 |
by-session/ta-921/j3/number2.py | amiraliakbari/sharif-mabani-python | 2 | 6623154 | print 'A'
x = 3
y = 2
print 'B'
if x > 10:
print "1"
else:
print x / y
print 'C'
print x * 1.0 / y
print 2 / (y - 2)
print 'D'
x = 3.0
y = 2.0
print x / y
| print 'A'
x = 3
y = 2
print 'B'
if x > 10:
print "1"
else:
print x / y
print 'C'
print x * 1.0 / y
print 2 / (y - 2)
print 'D'
x = 3.0
y = 2.0
print x / y
| none | 1 | 3.838209 | 4 | |
solution/11655(ROT13).py | OMEGA-Y/CodingTest-sol | 0 | 6623155 | import sys
data = sys.stdin.readline().rstrip()
output = ""
for i in data:
if i.islower():
output += chr(97+int((ord(i)-ord('a')+13)%26))
elif i.isupper():
output += chr(65+int((ord(i)-ord('A')+13)%26))
else:
output += i
print(output) | import sys
data = sys.stdin.readline().rstrip()
output = ""
for i in data:
if i.islower():
output += chr(97+int((ord(i)-ord('a')+13)%26))
elif i.isupper():
output += chr(65+int((ord(i)-ord('A')+13)%26))
else:
output += i
print(output) | none | 1 | 3.363043 | 3 | |
problems/OF/auto/problem62_OF.py | sunandita/ICAPS_Summer_School_RAE_2020 | 5 | 6623156 | <reponame>sunandita/ICAPS_Summer_School_RAE_2020
__author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
This is a randomly generated problem
'''
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(id, item)... | __author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
This is a randomly generated problem
'''
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(id, item):
return max(1, np.random.beta(2, 2))
def Ge... | en | 0.887912 | This is a randomly generated problem | 2.265882 | 2 |
2_PG/2-2_A2C/model.py | stella-moon323/Reinforcement_Learning | 1 | 6623157 | import torch.nn as nn
class Net(nn.Module):
def __init__(self, input_nums, output_nums, hidden_nums):
super(Net, self).__init__()
self.layers = nn.Sequential(
nn.Linear(input_nums, hidden_nums),
nn.ReLU(inplace=True),
nn.Linear(hidden_nums, hidden_nums),
... | import torch.nn as nn
class Net(nn.Module):
def __init__(self, input_nums, output_nums, hidden_nums):
super(Net, self).__init__()
self.layers = nn.Sequential(
nn.Linear(input_nums, hidden_nums),
nn.ReLU(inplace=True),
nn.Linear(hidden_nums, hidden_nums),
... | none | 1 | 3.224252 | 3 | |
postcorrection/seq2seq_tester.py | shrutirij/ocr-post-correction | 35 | 6623158 | <reponame>shrutirij/ocr-post-correction<gh_stars>10-100
"""Module with functions for using a trained post-correction model to produce predictions on unseen input data.
The module can be used with a test set in order to get a text output and CER/WER metrics (lines 26).
It can also be used without a target prediction t... | """Module with functions for using a trained post-correction model to produce predictions on unseen input data.
The module can be used with a test set in order to get a text output and CER/WER metrics (lines 26).
It can also be used without a target prediction to only get the predicted output (line 40).
Copyright (c... | en | 0.817666 | Module with functions for using a trained post-correction model to produce predictions on unseen input data. The module can be used with a test set in order to get a text output and CER/WER metrics (lines 26). It can also be used without a target prediction to only get the predicted output (line 40). Copyright (c) 2... | 2.839709 | 3 |
src/pyndf/gui/widgets/control.py | Guillaume-Guardia/ndf-python | 0 | 6623159 | <filename>src/pyndf/gui/widgets/control.py
# -*- coding: utf-8 -*-
from pyndf.qtlib import QtWidgets
class ControlButtons(QtWidgets.QWidget):
"""Widget adding in status bar to control the execution of the thread
Args:
QtWidgets (QT):
"""
def __init__(self, windows, *args, **kwargs):
... | <filename>src/pyndf/gui/widgets/control.py
# -*- coding: utf-8 -*-
from pyndf.qtlib import QtWidgets
class ControlButtons(QtWidgets.QWidget):
"""Widget adding in status bar to control the execution of the thread
Args:
QtWidgets (QT):
"""
def __init__(self, windows, *args, **kwargs):
... | en | 0.777384 | # -*- coding: utf-8 -*- Widget adding in status bar to control the execution of the thread Args: QtWidgets (QT): # Create vertical layout # Cancel button # TODO find icon pause # Alt + C Cancel method which stop the thread execution safely with the set of a flag. | 2.91059 | 3 |
bacaml/conftest.py | phetdam/bac-advanced-ml | 0 | 6623160 | <reponame>phetdam/bac-advanced-ml<filename>bacaml/conftest.py<gh_stars>0
"""pytest fixtures required by all unit test subpackages.
.. codeauthor:: <NAME> <<EMAIL>>
"""
import pytest
@pytest.fixture(scope="session")
def global_seed():
"""Universal seed value to be reused by all test methods.
Returns
---... | """pytest fixtures required by all unit test subpackages.
.. codeauthor:: <NAME> <<EMAIL>>
"""
import pytest
@pytest.fixture(scope="session")
def global_seed():
"""Universal seed value to be reused by all test methods.
Returns
-------
int
"""
return 7 | en | 0.590198 | pytest fixtures required by all unit test subpackages. .. codeauthor:: <NAME> <<EMAIL>> Universal seed value to be reused by all test methods. Returns ------- int | 1.937557 | 2 |
tests/fixtures/q_functions/__init__.py | blacksph3re/garage | 1,500 | 6623161 | <filename>tests/fixtures/q_functions/__init__.py
from tests.fixtures.q_functions.simple_q_function import SimpleQFunction
__all__ = ['SimpleQFunction']
| <filename>tests/fixtures/q_functions/__init__.py
from tests.fixtures.q_functions.simple_q_function import SimpleQFunction
__all__ = ['SimpleQFunction']
| none | 1 | 1.24167 | 1 | |
Walkthru_10/ex_10_01.py | Witziger/Walkthru-Python | 0 | 6623162 | name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
counts = dict()
for line in handle:
if not line.startswith("From ") : continue
line = line.rstrip()
line = line.split()
time = line[5]
hour, minute, second = time.split(':')
counts[hour] = counts.get(hour... | name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
counts = dict()
for line in handle:
if not line.startswith("From ") : continue
line = line.rstrip()
line = line.split()
time = line[5]
hour, minute, second = time.split(':')
counts[hour] = counts.get(hour... | en | 0.573618 | #print (counts) | 3.429411 | 3 |
openstack_dashboard/test/integration_tests/pages/admin/system/flavorspage.py | ankur-gupta91/block_storage | 3 | 6623163 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | en | 0.859654 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d... | 1.840577 | 2 |
setup.py | TylerPflueger/CSCI4900 | 0 | 6623164 | <gh_stars>0
from setuptools import setup
_domaven_version = '0.0.1'
'''
'flake8',
'pyflakes',
'mccabe',
'pep8',
'dosocs2'
'''
install_requires = [
'treelib'
]
tests_require = [
'pytest'
]
setup(
name='domaven',
version=_domaven_version,
description='Connector between DoSOCSv2 and Maven for relat... | from setuptools import setup
_domaven_version = '0.0.1'
'''
'flake8',
'pyflakes',
'mccabe',
'pep8',
'dosocs2'
'''
install_requires = [
'treelib'
]
tests_require = [
'pytest'
]
setup(
name='domaven',
version=_domaven_version,
description='Connector between DoSOCSv2 and Maven for relationships',
... | en | 0.087476 | 'flake8', 'pyflakes', 'mccabe', 'pep8', 'dosocs2' | 1.283001 | 1 |
cla_backend/apps/checker/migrations/0001_initial.py | uk-gov-mirror/ministryofjustice.cla_backend | 3 | 6623165 | # coding=utf-8
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [("legalaid", "0003_eod_details")]
operations = [
migrations.CreateMod... | # coding=utf-8
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [("legalaid", "0003_eod_details")]
operations = [
migrations.CreateMod... | en | 0.644078 | # coding=utf-8 | 1.934536 | 2 |
router_change_ip.py | hbvj99/vianet-scripts | 2 | 6623166 | <filename>router_change_ip.py
# ISCOM HT803-1GE EPON Home Terminal
# Generate new public IP through reconnect
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriv... | <filename>router_change_ip.py
# ISCOM HT803-1GE EPON Home Terminal
# Generate new public IP through reconnect
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriv... | en | 0.692329 | # ISCOM HT803-1GE EPON Home Terminal # Generate new public IP through reconnect | 2.478469 | 2 |
marlin-firmware/buildroot/share/PlatformIO/scripts/common-cxxflags.py | voicevon/gogame_bot | 6 | 6623167 | <reponame>voicevon/gogame_bot
#
# common-cxxflags.py
# Convenience script to apply customizations to CPP flags
#
Import("env")
env.Append(CXXFLAGS=[
"-Wno-register"
#"-Wno-incompatible-pointer-types",
#"-Wno-unused-const-variable",
#"-Wno-maybe-uninitialized",
#"-Wno-sign-compare"
])
| #
# common-cxxflags.py
# Convenience script to apply customizations to CPP flags
#
Import("env")
env.Append(CXXFLAGS=[
"-Wno-register"
#"-Wno-incompatible-pointer-types",
#"-Wno-unused-const-variable",
#"-Wno-maybe-uninitialized",
#"-Wno-sign-compare"
]) | en | 0.57934 | # # common-cxxflags.py # Convenience script to apply customizations to CPP flags # #"-Wno-incompatible-pointer-types", #"-Wno-unused-const-variable", #"-Wno-maybe-uninitialized", #"-Wno-sign-compare" | 1.487318 | 1 |
aghlam/migrations/0007_aghlam_external.py | mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company | 30 | 6623168 | <filename>aghlam/migrations/0007_aghlam_external.py
# Generated by Django 2.2.2 on 2019-07-21 11:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aghlam', '0006_auto_20190721_1122'),
]
operations = [
migrations.AddField(
m... | <filename>aghlam/migrations/0007_aghlam_external.py
# Generated by Django 2.2.2 on 2019-07-21 11:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aghlam', '0006_auto_20190721_1122'),
]
operations = [
migrations.AddField(
m... | en | 0.763552 | # Generated by Django 2.2.2 on 2019-07-21 11:25 | 1.272019 | 1 |
tests/test_make_dataset.py | Hannemit/data_science_projects | 0 | 6623169 | <filename>tests/test_make_dataset.py
import pandas as pd
CHOROPLETH_FILE = "./tests/data/choropleth_df.csv"
CONVENIENT_FILE = "./tests/data/year_country_data.csv"
def test_make_df_nicer_format():
"""
Perform some checks on whether we didn't change anything weird in making the more convenient dataframe to work... | <filename>tests/test_make_dataset.py
import pandas as pd
CHOROPLETH_FILE = "./tests/data/choropleth_df.csv"
CONVENIENT_FILE = "./tests/data/year_country_data.csv"
def test_make_df_nicer_format():
"""
Perform some checks on whether we didn't change anything weird in making the more convenient dataframe to work... | en | 0.938221 | Perform some checks on whether we didn't change anything weird in making the more convenient dataframe to work with It should contain the same information as the choropleth dataframe, just differently structured. We're here just checking that they're similar # sort_index to get same col order # pick some random... | 3.641819 | 4 |
examples/jetson_nano/example_technichub_jetson_nano.py | AlexandrePoisson/pylgbst | 0 | 6623170 | <reponame>AlexandrePoisson/pylgbst
from pylgbst.hub import TechnicHub
from pylgbst import get_connection_gattool
from pylgbst.peripherals import Motor,EncodedMotor
import time
import random
def callback(value):
print("Voltage: %s" % value)
conn = get_connection_gattool(hub_mac='90:84:2B:5F:33:35') #auto connect... | from pylgbst.hub import TechnicHub
from pylgbst import get_connection_gattool
from pylgbst.peripherals import Motor,EncodedMotor
import time
import random
def callback(value):
print("Voltage: %s" % value)
conn = get_connection_gattool(hub_mac='90:84:2B:5F:33:35') #auto connect does not work
hub = TechnicHub(con... | en | 0.697338 | #auto connect does not work #hub.connection.notification_delayed('050082030a', 0.1) #here motor really moves #here motor really moves #hub.connection.notification_delayed('050082030a', 0.1) #here motor really stops Output 0 50 => 0x32 59 => 0x3B 60 => 0x3C Goodbye | 2.494912 | 2 |
servers/bazarr/scripts/findRename.py | beakerflo/nas_synology_docker-compose | 3 | 6623171 | <reponame>beakerflo/nas_synology_docker-compose
import os
from datetime import datetime
dateString = (datetime.now()).strftime("%Y%m%d_%H%M%S")
os.rename('/volume1/containers/services/bazarr/scripts/rename.sh', '/volume1/containers/services/bazarr/scripts/rename.sh_' + dateString + '.txt')
renameSrt = open('/volume1... | import os
from datetime import datetime
dateString = (datetime.now()).strftime("%Y%m%d_%H%M%S")
os.rename('/volume1/containers/services/bazarr/scripts/rename.sh', '/volume1/containers/services/bazarr/scripts/rename.sh_' + dateString + '.txt')
renameSrt = open('/volume1/containers/services/bazarr/scripts/rename.sh','... | none | 1 | 2.424469 | 2 | |
src/main.py | loreloc/exoplanet-detection | 5 | 6623172 | import numpy as np
import sklearn as sk
import sklearn.model_selection
from rfc_worker import RFCWorker
from hb_optimizer import HBOptimizer
from metrics import compute_metrics
from koi_dataset import load_koi_dataset
# Set the LOCALHOST, PROJECT_NAME constants
LOCALHOST = '127.0.0.1'
PROJECT_NAME = 'exoplanet-detecti... | import numpy as np
import sklearn as sk
import sklearn.model_selection
from rfc_worker import RFCWorker
from hb_optimizer import HBOptimizer
from metrics import compute_metrics
from koi_dataset import load_koi_dataset
# Set the LOCALHOST, PROJECT_NAME constants
LOCALHOST = '127.0.0.1'
PROJECT_NAME = 'exoplanet-detecti... | en | 0.544526 | # Set the LOCALHOST, PROJECT_NAME constants # Set the parameters for hyperparameters optimization # Load the dataset # Initialize the optimizer # Repeat multiple times the test # Split the dataset in train set and test set # Start the optimizer # Run the optimizer # Build and train the best model # Compute some evaluat... | 2.546557 | 3 |
app/views/display_tasks_view.py | namuan/task-rider | 0 | 6623173 | <filename>app/views/display_tasks_view.py
import logging
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt, QModelIndex
from PyQt5.QtWidgets import QMenu, QAction
from app.widgets.completed_task_item_widget import CompletedTaskItemWidget
from app.widgets.task_item_widget import TaskItemWidget
class DisplayTas... | <filename>app/views/display_tasks_view.py
import logging
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt, QModelIndex
from PyQt5.QtWidgets import QMenu, QAction
from app.widgets.completed_task_item_widget import CompletedTaskItemWidget
from app.widgets.task_item_widget import TaskItemWidget
class DisplayTas... | none | 1 | 2.184412 | 2 | |
model.py | Information-Fusion-Lab-Umass/NoisyInjectiveFlows | 0 | 6623174 | <filename>model.py
import os
import glob
import jax
import jax.numpy as jnp
import staxplusplus as spp
import normalizing_flows as nf
import jax.nn.initializers as jaxinit
from jax.tree_util import tree_flatten
import util
import non_dim_preserving as ndp
from functools import partial
#################################... | <filename>model.py
import os
import glob
import jax
import jax.numpy as jnp
import staxplusplus as spp
import normalizing_flows as nf
import jax.nn.initializers as jaxinit
from jax.tree_util import tree_flatten
import util
import non_dim_preserving as ndp
from functools import partial
#################################... | de | 0.650966 | ###################################################################################################################################################### ##################################################################### # Use uniform dequantization to build our model ###################################################... | 2.285354 | 2 |
Printer.py | dgirzadas/Pulse-of-the-City | 2 | 6623175 | def loading_bar(percentage):
if percentage < 100:
print("[" + "-" * percentage + " " * (100 - percentage) + "] " + str(percentage) + "%", end='\r')
else:
print("[" + "-" * percentage + " " * (100 - percentage) + "] " + "Done!") | def loading_bar(percentage):
if percentage < 100:
print("[" + "-" * percentage + " " * (100 - percentage) + "] " + str(percentage) + "%", end='\r')
else:
print("[" + "-" * percentage + " " * (100 - percentage) + "] " + "Done!") | none | 1 | 3.08356 | 3 | |
flowgraph/config.py | Bhaskers-Blu-Org1/pyflowgraph | 17 | 6623176 | <reponame>Bhaskers-Blu-Org1/pyflowgraph
c.RemoteAnnotationDB.api_url = "https://api.datascienceontology.org"
| c.RemoteAnnotationDB.api_url = "https://api.datascienceontology.org" | none | 1 | 1.247719 | 1 | |
bax_insertion/util/error_propagation.py | johnbachman/bax_insertion_paper | 0 | 6623177 | <reponame>johnbachman/bax_insertion_paper
import numpy as np
def calc_ratio_sd(numer_mean, numer_sd, denom_mean, denom_sd,
num_samples=10000):
"""Calculates the variance of a ratio of two normal distributions with
the given means and standard deviations."""
numer_samples = numer_mean + (n... | import numpy as np
def calc_ratio_sd(numer_mean, numer_sd, denom_mean, denom_sd,
num_samples=10000):
"""Calculates the variance of a ratio of two normal distributions with
the given means and standard deviations."""
numer_samples = numer_mean + (numer_sd * np.random.randn(num_samples))
... | en | 0.885717 | Calculates the variance of a ratio of two normal distributions with the given means and standard deviations. Calculates the variance of a ratio of two normal distributions with the given means and standard deviations. # If we're dealing with a numpy array: # Otherwise, assume we're dealing with a number | 3.641943 | 4 |
selenium/spider.py | andrewsmedina/scrap-tools-benchmarking | 2 | 6623178 | from selenium import webdriver
driver = webdriver.Firefox()
journal_url = "http://www.rondonopolis.mt.gov.br/diario-oficial/"
driver.get(journal_url)
pdf_links = driver.find_elements_by_css_selector("table a")
for link in pdf_links:
print(link.get_attribute("href"))
driver.close() | from selenium import webdriver
driver = webdriver.Firefox()
journal_url = "http://www.rondonopolis.mt.gov.br/diario-oficial/"
driver.get(journal_url)
pdf_links = driver.find_elements_by_css_selector("table a")
for link in pdf_links:
print(link.get_attribute("href"))
driver.close() | none | 1 | 2.794113 | 3 | |
train_arguments.py | kun193/ransomware-classification | 7 | 6623179 | import argparse
import os
class Arguments():
def __init__(self):
self.initialized = False
def initialize(self, parser):
parser.add_argument('name', type=str, help='experiment name.')
parser.add_argument('--phase', default='train', type=str, choices=['train', 'test'], help='determini... | import argparse
import os
class Arguments():
def __init__(self):
self.initialized = False
def initialize(self, parser):
parser.add_argument('name', type=str, help='experiment name.')
parser.add_argument('--phase', default='train', type=str, choices=['train', 'test'], help='determini... | none | 1 | 2.903597 | 3 | |
foundation/press/views.py | pilnujemy/foundation-manager | 1 | 6623180 | from braces.views import SelectRelatedMixin
from django.views.generic.dates import ArchiveIndexView
from django.views.generic.dates import YearArchiveView
from django.views.generic.dates import MonthArchiveView
from django.views.generic.dates import DayArchiveView
from django.views.generic import DetailView
from django... | from braces.views import SelectRelatedMixin
from django.views.generic.dates import ArchiveIndexView
from django.views.generic.dates import YearArchiveView
from django.views.generic.dates import MonthArchiveView
from django.views.generic.dates import DayArchiveView
from django.views.generic import DetailView
from django... | none | 1 | 2.020676 | 2 | |
server.py | keithnull/ace-power | 4 | 6623181 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import entry
app = FastAPI()
origins = [
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
... | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import entry
app = FastAPI()
origins = [
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
... | none | 1 | 2.542464 | 3 | |
django/bosscore/lookup.py | ArnaudGallardo/boss | 20 | 6623182 | <gh_stars>10-100
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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
#
#... | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | en | 0.793337 | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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 ... | 2.278519 | 2 |
process/honda-label/ProjectGPSonVideo.py | sameeptandon/sail-car-log | 1 | 6623183 | import pickle
import sys, os
from GPSReader import *
from VideoReader import *
from WGS84toENU import *
from GPSReprojection import *
from transformations import euler_matrix
from numpy import array, dot, zeros, around, divide, nonzero, float32, maximum
import numpy as np
from cv2 import imshow, waitKey, resize, warpPe... | import pickle
import sys, os
from GPSReader import *
from VideoReader import *
from WGS84toENU import *
from GPSReprojection import *
from transformations import euler_matrix
from numpy import array, dot, zeros, around, divide, nonzero, float32, maximum
import numpy as np
from cv2 import imshow, waitKey, resize, warpPe... | en | 0.404959 | #gps_filename = sys.argv[2] #framenum = 1926; #framenum = 29000 #if framenum % 10 != 0: # continue src = array([[0,0],[1280,0],[1280,960],[0,960]], float32) minX = 0 minY = 0 maxX = 1200 maxY = 960 dst = array([[-1000,200],[2280,200],[780,960],[500,960]], float32) #src = array([(567, 759)... | 2.28926 | 2 |
memery/core.py | wkrettek/memery | 0 | 6623184 | # Builtins
import time
from pathlib import Path
import logging
# Dependencies
import torch
from torch import Tensor, device
from torchvision.transforms import Compose
from PIL import Image
# Local imports
from memery import loader, crafter, encoder, indexer, ranker
class Memery():
def __init__(self, root: str ... | # Builtins
import time
from pathlib import Path
import logging
# Dependencies
import torch
from torch import Tensor, device
from torchvision.transforms import Compose
from PIL import Image
# Local imports
from memery import loader, crafter, encoder, indexer, ranker
class Memery():
def __init__(self, root: str ... | en | 0.708312 | # Builtins # Dependencies # Local imports Indexes images in path, returns the location of save files # Check if we should re-index the files # Crafting and encoding # Reindexing Indexes a folder and returns file paths ranked by query. Parameters: path (str): Folder to search query (str)... | 2.095909 | 2 |
JTScheduler/JTScheduler_main.py | MaciejGGH/JTDataOrchestrator | 0 | 6623185 | <filename>JTScheduler/JTScheduler_main.py
# -*- coding: utf-8 -*
#-------------------------------------------------------------------------------
# Name: Informatica Scheduler
# Purpose:
#
# Author: <NAME>
#
# Created: 22.02.2017
# Copyright: (c) macie 2017
# Licence: <your licence>
#---... | <filename>JTScheduler/JTScheduler_main.py
# -*- coding: utf-8 -*
#-------------------------------------------------------------------------------
# Name: Informatica Scheduler
# Purpose:
#
# Author: <NAME>
#
# Created: 22.02.2017
# Copyright: (c) macie 2017
# Licence: <your licence>
#---... | en | 0.361317 | # -*- coding: utf-8 -* #------------------------------------------------------------------------------- # Name: Informatica Scheduler # Purpose: # # Author: <NAME> # # Created: 22.02.2017 # Copyright: (c) macie 2017 # Licence: <your licence> #-------------------------------------------------------... | 2.091833 | 2 |
sandbox/ex2/exps/doom.py | sokol1412/rllab_hierarchical_rl | 0 | 6623186 | from sandbox.ex2.algos.trpo import TRPO
from rllab.envs.normalized_env import normalize
from rllab.misc.instrument import stub, run_experiment_lite
from rllab.policies.categorical_conv_policy import CategoricalConvPolicy
import lasagne.nonlinearities as NL
from sandbox.ex2.envs.cropped_gym_env import CroppedGymEnv
... | from sandbox.ex2.algos.trpo import TRPO
from rllab.envs.normalized_env import normalize
from rllab.misc.instrument import stub, run_experiment_lite
from rllab.policies.categorical_conv_policy import CategoricalConvPolicy
import lasagne.nonlinearities as NL
from sandbox.ex2.envs.cropped_gym_env import CroppedGymEnv
... | en | 0.438431 | # TODO Try Relu #1, #whole_paths=False, #sampler_cls=BatchSampler, #sampler_arg=sampler_args, #use_gpu=True, | 1.710401 | 2 |
generators/examples/hosts.py | davidyshuang/python3 | 0 | 6623187 | # hosts.py
#
# Find unique host IP addresses
from linesdir import lines_from_dir
from apachelog import apache_log
lines = lines_from_dir("access-log*","www")
log = apache_log(lines)
hosts = set(r['host'] for r in log)
for h in hosts:
print(h)
| # hosts.py
#
# Find unique host IP addresses
from linesdir import lines_from_dir
from apachelog import apache_log
lines = lines_from_dir("access-log*","www")
log = apache_log(lines)
hosts = set(r['host'] for r in log)
for h in hosts:
print(h)
| en | 0.738287 | # hosts.py # # Find unique host IP addresses | 2.713811 | 3 |
finder.py | bckhm/EmailMatcher | 1 | 6623188 | import re
import pandas as pd
# Function that searches data.txt for email/phone numbers before returning a dictionary
def find_data(pattern, column_name):
with open('data.txt', 'r') as file:
contents = file.read()
matches = pattern.findall(contents)
matches_dict = {column_name: matches}... | import re
import pandas as pd
# Function that searches data.txt for email/phone numbers before returning a dictionary
def find_data(pattern, column_name):
with open('data.txt', 'r') as file:
contents = file.read()
matches = pattern.findall(contents)
matches_dict = {column_name: matches}... | en | 0.827275 | # Function that searches data.txt for email/phone numbers before returning a dictionary # Function that converts aobve dictionary to excel # Dictionary that gives varying patterns. column names and file names based on user input # Allows users to select between finding email addresses/phone numbers | 4.136726 | 4 |
benchmarks/sample_fsm/Test_Utilities.py | nuprl/retic_performance | 3 | 6623189 | import pytest
from Untyped.Utilities import relative_average, accumulated_s
def test_relative_average():
assert relative_average([1, 2, 3], 1) == 2
assert relative_average([1, 2, 3], 2) == 1
def test_accumulated_s():
assert accumulated_s([1]) == [1]
assert accumulated_s([2, 2]) == [.5, 1]
assert a... | import pytest
from Untyped.Utilities import relative_average, accumulated_s
def test_relative_average():
assert relative_average([1, 2, 3], 1) == 2
assert relative_average([1, 2, 3], 2) == 1
def test_accumulated_s():
assert accumulated_s([1]) == [1]
assert accumulated_s([2, 2]) == [.5, 1]
assert a... | none | 1 | 2.678093 | 3 | |
__init__.py | manahter/tarag | 3 | 6623190 | """
Info:
module : Tarag
description : Ağdaki cihazları bulur
author : Manahter
Files:
getmac : IP adresini kullanarak MAC adresini bulmamıza yardımcı olur.
get_mac_address(ip=ip)
main source: "https://github.com/GhostofGoes/getmac",
getvendor ... | """
Info:
module : Tarag
description : Ağdaki cihazları bulur
author : Manahter
Files:
getmac : IP adresini kullanarak MAC adresini bulmamıza yardımcı olur.
get_mac_address(ip=ip)
main source: "https://github.com/GhostofGoes/getmac",
getvendor ... | tr | 0.980864 | Info: module : Tarag description : Ağdaki cihazları bulur author : Manahter Files: getmac : IP adresini kullanarak MAC adresini bulmamıza yardımcı olur. get_mac_address(ip=ip) main source: "https://github.com/GhostofGoes/getmac", getvendor : MA... | 2.360084 | 2 |
sdbms/app/views.py | xSkyripper/simple-fs-dbms | 0 | 6623191 | <reponame>xSkyripper/simple-fs-dbms<gh_stars>0
from flask import Blueprint, render_template, request
from sdbms.app.service.builder import QueryBuilder
from sdbms.core._manager import DbManager
from sdbms.core._parser import QueryParser, CommandError
"""
Web api that builds the query and sends it to the query manager.... | from flask import Blueprint, render_template, request
from sdbms.app.service.builder import QueryBuilder
from sdbms.core._manager import DbManager
from sdbms.core._parser import QueryParser, CommandError
"""
Web api that builds the query and sends it to the query manager.
Each route will represent a different CRUD op... | en | 0.870266 | Web api that builds the query and sends it to the query manager. Each route will represent a different CRUD operation and for each operation you will need to send a form with the certain data, and as result we will receive a html page. 1.'/' we will display the menu that will give you all the hiperlinks for each oper... | 2.844118 | 3 |
extraPackages/Pillow-6.0.0/Tests/test_uploader.py | dolboBobo/python3_ios | 130 | 6623192 | <filename>extraPackages/Pillow-6.0.0/Tests/test_uploader.py
from .helper import PillowTestCase, hopper
class TestUploader(PillowTestCase):
def check_upload_equal(self):
result = hopper('P').convert('RGB')
target = hopper('RGB')
self.assert_image_equal(result, target)
def check_upload_... | <filename>extraPackages/Pillow-6.0.0/Tests/test_uploader.py
from .helper import PillowTestCase, hopper
class TestUploader(PillowTestCase):
def check_upload_equal(self):
result = hopper('P').convert('RGB')
target = hopper('RGB')
self.assert_image_equal(result, target)
def check_upload_... | none | 1 | 2.27951 | 2 | |
Behavioral-Patterns/Interpreter/lexing_and_parsing.py | PratikRamdasi/Design-Patterns-in-Python | 0 | 6623193 | # Evaluate numerical expression
from enum import Enum, auto
class Token:
# Token can be anything - numeric INT value or brackets
class Type(Enum):
INTEGER = auto()
PLUS = auto()
MINUS = auto()
LPAREN = auto() # left paranthesis
RPAREN = auto() # right paranthesis
de... | # Evaluate numerical expression
from enum import Enum, auto
class Token:
# Token can be anything - numeric INT value or brackets
class Type(Enum):
INTEGER = auto()
PLUS = auto()
MINUS = auto()
LPAREN = auto() # left paranthesis
RPAREN = auto() # right paranthesis
de... | en | 0.71128 | # Evaluate numerical expression # Token can be anything - numeric INT value or brackets # left paranthesis # right paranthesis # takes the type of token and associated text with it # (for printing the text mainly) # see whitespace by using ` ` # input is a string # check every char - 1 char # integer - more than 1 char... | 3.860278 | 4 |
btdata.py | bstitt79/muzero-general | 0 | 6623194 | <reponame>bstitt79/muzero-general<filename>btdata.py<gh_stars>0
companies = [
'OEDV',
'AAPL',
'BAC',
'AMZN',
'T',
'GOOG',
'MO',
'DAL',
'AA',
'AXP',
'DD',
'BABA',
'ABT',
'UA',
'AMAT',
'AMGN',
'AAL',
'AIG',
'... | companies = [
'OEDV',
'AAPL',
'BAC',
'AMZN',
'T',
'GOOG',
'MO',
'DAL',
'AA',
'AXP',
'DD',
'BABA',
'ABT',
'UA',
'AMAT',
'AMGN',
'AAL',
'AIG',
'ALL',
'ADBE',
'GOOGL',
'ACN',
'ABBV',
... | none | 1 | 1.301624 | 1 | |
scripts/shared/file_utils.py | cric96/scala-native-benchmarks | 13 | 6623195 | <reponame>cric96/scala-native-benchmarks
import os
import errno
import subprocess as subp
def mkdir(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def touch(path):
... | import os
import errno
import subprocess as subp
def mkdir(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def touch(path):
open(path, 'w+').close()
def slurp(path)... | en | 0.298393 | # Python >2.5 | 2.761861 | 3 |
scripts/utils/make_template.py | mozilla-releng/staging-mozilla-vpn-client | 0 | 6623196 | <filename>scripts/utils/make_template.py
#! /usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import argparse
# Parse arguments to determ... | <filename>scripts/utils/make_template.py
#! /usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import argparse
# Parse arguments to determ... | en | 0.843204 | #! /usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Parse arguments to determine what to do. # Build up a dictionary of keywords and their replacem... | 2.502912 | 3 |
examples/spot/mining/mining_hashrate_resale_request.py | Banging12/binance-connector-python | 512 | 6623197 | #!/usr/bin/env python
import logging
from binance.spot import Spot as Client
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
key = ""
secret = ""
params = {
"algo": "sha256",
"userName": "user_name",
"startDate": 1607659086000,
"endDate": 1617659086000,
"toPoo... | #!/usr/bin/env python
import logging
from binance.spot import Spot as Client
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
key = ""
secret = ""
params = {
"algo": "sha256",
"userName": "user_name",
"startDate": 1607659086000,
"endDate": 1617659086000,
"toPoo... | ru | 0.26433 | #!/usr/bin/env python | 2.050379 | 2 |
mapss/static/packages/arches/arches/app/models/concept.py | MPI-MAPSS/MAPSS | 0 | 6623198 | """
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 <NAME> and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, e... | """
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 <NAME> and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, e... | en | 0.574605 | ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 <NAME> and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either... | 2.15739 | 2 |
Jobs/Propensity_net_NN.py | Shantanu48114860/DPN-SA | 2 | 6623199 | """
MIT License
Copyright (c) 2020 <NAME>
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 rights
to use, copy, modify, merge, publish, distri... | """
MIT License
Copyright (c) 2020 <NAME>
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 rights
to use, copy, modify, merge, publish, distri... | en | 0.717884 | MIT License Copyright (c) 2020 <NAME> 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 rights to use, copy, modify, merge, publish, distribute... | 1.863243 | 2 |
tests/utils.py | riptano/argus | 2 | 6623200 | # Copyright 2018 DataStax, 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 writin... | # Copyright 2018 DataStax, 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 writin... | en | 0.896665 | # Copyright 2018 DataStax, 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 writin... | 2.41546 | 2 |
Clase_1/snippets/hint_q1.py | uncrayon/python-para-sistemas | 0 | 6623201 | # Recuerda que el radio es la mitad del diámetro.
# Por otro lado, si nosotros quisieramos saber cuanto es 51 entre 17 lo podemos guardar en una variable
# Resultado_Sorprendente = 51 / 17
# Y luego esa podemos usarla para otros calculos como:
# Resultado_Sorprendete_2 = (Resultado_Sorprendente ** 2) * 11 | # Recuerda que el radio es la mitad del diámetro.
# Por otro lado, si nosotros quisieramos saber cuanto es 51 entre 17 lo podemos guardar en una variable
# Resultado_Sorprendente = 51 / 17
# Y luego esa podemos usarla para otros calculos como:
# Resultado_Sorprendete_2 = (Resultado_Sorprendente ** 2) * 11 | es | 0.876126 | # Recuerda que el radio es la mitad del diámetro. # Por otro lado, si nosotros quisieramos saber cuanto es 51 entre 17 lo podemos guardar en una variable # Resultado_Sorprendente = 51 / 17 # Y luego esa podemos usarla para otros calculos como: # Resultado_Sorprendete_2 = (Resultado_Sorprendente ** 2) * 11 | 1.94188 | 2 |
tests/test_nptorch.py | guitargeek/geeksw | 2 | 6623202 | <reponame>guitargeek/geeksw
import unittest
import numpy as np
import torch
import geeksw.nptorch as nt
class Test(unittest.TestCase):
def test_nptorch(self):
a = np.random.uniform(size=10)
t = torch.tensor(a)
def test_f(f, f_ref):
np.testing.assert_array_almost_equal(f(a), f... | import unittest
import numpy as np
import torch
import geeksw.nptorch as nt
class Test(unittest.TestCase):
def test_nptorch(self):
a = np.random.uniform(size=10)
t = torch.tensor(a)
def test_f(f, f_ref):
np.testing.assert_array_almost_equal(f(a), f(t).numpy())
np.... | none | 1 | 2.66131 | 3 | |
tests/test_schematic_upload.py | Frumple/mrt-file-server | 2 | 6623203 | <reponame>Frumple/mrt-file-server
from test_schematic_base import TestSchematicBase
from unittest.mock import call, patch
from werkzeug.datastructures import OrderedMultiDict
from io import BytesIO
import os
import pytest
class TestSchematicUpload(TestSchematicBase):
def setup(self):
TestSchematicBase.setup(se... | from test_schematic_base import TestSchematicBase
from unittest.mock import call, patch
from werkzeug.datastructures import OrderedMultiDict
from io import BytesIO
import os
import pytest
class TestSchematicUpload(TestSchematicBase):
def setup(self):
TestSchematicBase.setup(self)
self.uploads_dir = self.ap... | en | 0.941261 | # Tests # Upload 5 files # Upload 12 files, over the limit of 10. # Copy an impostor file with different content to the uploads directory with the same name as the file to upload # Verify that the uploads directory has only the impostor file, and the file has not been modified # Helper Functions | 2.229117 | 2 |
main.py | grimmpp/cloudFoundryServiceBroker | 0 | 6623204 | import sys
sys.path.append('cfBroker')
from cfBroker.app import App
App().start() | import sys
sys.path.append('cfBroker')
from cfBroker.app import App
App().start() | none | 1 | 1.225134 | 1 | |
commonutils.py | troxel/t_mon | 0 | 6623205 | import pprint
import os
import os.path
import subprocess
import cherrypy
class Utils:
# Common utils to mostly handle ro/rw issues and other common needs
def __init__(self):
version = 1.0;
self.is_ro = self.is_filesys_ro()
# -----------------------
# Write file to a ro filesystem
def writ... | import pprint
import os
import os.path
import subprocess
import cherrypy
class Utils:
# Common utils to mostly handle ro/rw issues and other common needs
def __init__(self):
version = 1.0;
self.is_ro = self.is_filesys_ro()
# -----------------------
# Write file to a ro filesystem
def writ... | en | 0.764125 | # Common utils to mostly handle ro/rw issues and other common needs # ----------------------- # Write file to a ro filesystem # If filesystem is currently ro then umount ro and remount rw # Otherwise leave alone # ------------------------ # ------------------------ # Forces write from buffer to disk... # If the filesys... | 2.270466 | 2 |
subset.py | andrewgryan/swift-testbed | 0 | 6623206 | <filename>subset.py
#!/usr/bin/env python
'''
Read data from a netCDF file, cut out a sub-region and save to a new file
'''
import sys
import os
import iris
import argparse
def parse_args(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument("in_file",
help="file to extra... | <filename>subset.py
#!/usr/bin/env python
'''
Read data from a netCDF file, cut out a sub-region and save to a new file
'''
import sys
import os
import iris
import argparse
def parse_args(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument("in_file",
help="file to extra... | en | 0.727173 | #!/usr/bin/env python Read data from a netCDF file, cut out a sub-region and save to a new file # Cut out a domain | 3.389354 | 3 |
visualization/dashapp/index.py | Lchuang/yews | 0 | 6623207 | #!/Users/lindsaychuang/miniconda3/envs/obspy/bin/python
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from app import app
from apps import geomaps, Continuous_WF
# ---- 02. Page contents
app.layout = html.Div([
dcc.Location(id='url', refre... | #!/Users/lindsaychuang/miniconda3/envs/obspy/bin/python
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from app import app
from apps import geomaps, Continuous_WF
# ---- 02. Page contents
app.layout = html.Div([
dcc.Location(id='url', refre... | en | 0.445499 | #!/Users/lindsaychuang/miniconda3/envs/obspy/bin/python # ---- 02. Page contents | 2.073131 | 2 |
pop_tools/datasets.py | dcherian/pop-tools | 0 | 6623208 | <filename>pop_tools/datasets.py
"""
Functions to load sample data
"""
import os
import pkg_resources
import pooch
DATASETS = pooch.create(
path=['~', '.pop_tools', 'data'],
version_dev='master',
base_url='ftp://ftp.cgd.ucar.edu/archive/aletheia-data/cesm-data/ocn/',
)
DATASETS.load_registry(pkg_resource... | <filename>pop_tools/datasets.py
"""
Functions to load sample data
"""
import os
import pkg_resources
import pooch
DATASETS = pooch.create(
path=['~', '.pop_tools', 'data'],
version_dev='master',
base_url='ftp://ftp.cgd.ucar.edu/archive/aletheia-data/cesm-data/ocn/',
)
DATASETS.load_registry(pkg_resource... | en | 0.811216 | Functions to load sample data | 1.721295 | 2 |
xcube_hub/models/user_user_metadata.py | bcdev/xcube-hub | 3 | 6623209 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from xcube_hub.models.base_model_ import Model
from xcube_hub import util
from xcube_hub.models.subscription import Subscription
class UserUserMetadata(Model):
""... | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from xcube_hub.models.base_model_ import Model
from xcube_hub import util
from xcube_hub.models.subscription import Subscription
class UserUserMetadata(Model):
""... | en | 0.501917 | # coding: utf-8 # noqa: F401 # noqa: F401 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. UserUserMetadata - a model defined in OpenAPI :param client_id: The client_id of this UserUserMetadata. # noqa: E501 :type client_id: s... | 2.19699 | 2 |
bioprocs/scripts/tsv/pTsv2Xlsx.py | pwwang/biopipen | 2 | 6623210 | <gh_stars>1-10
import csv
from os import path
from openpyxl import Workbook
infile = {{i.infile | quote}}
outfile = {{o.outfile | quote}}
fn2sheet = {{args.fn2sheet}}
def tsv2sheet(wb, tsvfile):
ws = wb.create_sheet('Sheet1')
with open(tsvfile) as f:
reader = csv.reader(f, delimiter = "\t")
for row in reader:... | import csv
from os import path
from openpyxl import Workbook
infile = {{i.infile | quote}}
outfile = {{o.outfile | quote}}
fn2sheet = {{args.fn2sheet}}
def tsv2sheet(wb, tsvfile):
ws = wb.create_sheet('Sheet1')
with open(tsvfile) as f:
reader = csv.reader(f, delimiter = "\t")
for row in reader:
ws.append(r... | uk | 0.055452 | # remove default sheet | 2.966441 | 3 |
createManifest.py | Kaseaa/Tera-Manifest-Auto-Updater | 0 | 6623211 | import json
import os
from Crypto.Hash import SHA256
from multiprocessing.pool import ThreadPool as pool
DEF_SYNTAXES = [
"dispatch.toServer",
"dispatch.toClient",
"dispatch.hook"
]
IGNORE_FILES = [
'createManifest.py',
'createManifest.exe',
'manifest.json',
'module.json'
]... | import json
import os
from Crypto.Hash import SHA256
from multiprocessing.pool import ThreadPool as pool
DEF_SYNTAXES = [
"dispatch.toServer",
"dispatch.toClient",
"dispatch.hook"
]
IGNORE_FILES = [
'createManifest.py',
'createManifest.exe',
'manifest.json',
'module.json'
]... | en | 0.886336 | Get all the files for a given filepath
:param path: The parent directory
:param excluded: An array of excluded file names
:return: An array of filepaths Get the SHA256 value of a byte string Gets the definition version and name using a given syntax
:param data: the data to look for this information ... | 2.623403 | 3 |
extras/wordlist.py | i1470s/IVRY | 3 | 6623212 | words = ['simp', 'SIMP', 'fag', 'FAG', 'faggot', 'FAGGOT', 'nigger', 'NIGGER'] | words = ['simp', 'SIMP', 'fag', 'FAG', 'faggot', 'FAGGOT', 'nigger', 'NIGGER'] | none | 1 | 2.071484 | 2 | |
app/models.py | rahulraj6000/E-commerce | 0 | 6623213 | from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
STATE_CHOICES = (
('Andaman & Nicobar Island ', 'Andaman & Nicobar Islands'),
('Andhra Pradesh', 'Andhra Pradesh'),
('Arunachal Pradesh', 'Arunachal Pradesh'),
... | from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
STATE_CHOICES = (
('Andaman & Nicobar Island ', 'Andaman & Nicobar Islands'),
('Andhra Pradesh', 'Andhra Pradesh'),
('Arunachal Pradesh', 'Arunachal Pradesh'),
... | none | 1 | 2.412412 | 2 | |
apps/locations/forms.py | ExpoAshique/ProveBanking__s | 0 | 6623214 | from django import forms
from django.utils.translation import ugettext_lazy as _
from med_social.forms.base import DeletableFieldsetForm
from med_social.utils import slugify
from .models import Location
from med_social.forms.mixins import FieldsetMixin
class LocationCreateForm(forms.ModelForm, FieldsetMixin):
fi... | from django import forms
from django.utils.translation import ugettext_lazy as _
from med_social.forms.base import DeletableFieldsetForm
from med_social.utils import slugify
from .models import Location
from med_social.forms.mixins import FieldsetMixin
class LocationCreateForm(forms.ModelForm, FieldsetMixin):
fi... | none | 1 | 2.042417 | 2 | |
cointrol/utils.py | fakegit/cointrol | 967 | 6623215 | import json as _json
from decimal import Decimal
from functools import partial
import rest_framework.utils.encoders
class JSONEncoder(rest_framework.utils.encoders.JSONEncoder):
def default(self, o):
if isinstance(o, Decimal):
return float(o)
return super().default(o)
class json:
... | import json as _json
from decimal import Decimal
from functools import partial
import rest_framework.utils.encoders
class JSONEncoder(rest_framework.utils.encoders.JSONEncoder):
def default(self, o):
if isinstance(o, Decimal):
return float(o)
return super().default(o)
class json:
... | none | 1 | 2.465285 | 2 | |
zilean/datasets/basics.py | A-Hilaly/zilean | 0 | 6623216 | <filename>zilean/datasets/basics.py
from greww.data.mysql import MysqlPen as M
class BasicTable(object):
"""
Basic Table Modelisation Sample
"""
__slots__ = ["_data"]
db = ""
table = ""
fields = []
def __init__(self):
"""
Initialise class instance with table content a... | <filename>zilean/datasets/basics.py
from greww.data.mysql import MysqlPen as M
class BasicTable(object):
"""
Basic Table Modelisation Sample
"""
__slots__ = ["_data"]
db = ""
table = ""
fields = []
def __init__(self):
"""
Initialise class instance with table content a... | en | 0.636711 | Basic Table Modelisation Sample Initialise class instance with table content as data ==================================================== Call __init__() in order to rewrite _data attribute with the newest table ==================================================== Return a Dict (Json type) with ... | 2.615186 | 3 |
setup.py | dani-garcia/multiview_gpu | 5 | 6623217 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="multiview_gpu",
version="0.1.0",
author="<NAME>",
author_email="<EMAIL>",
description="GPU-accelerated multiview clustering and dimensionality reduction",
long_description=long_descrip... | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="multiview_gpu",
version="0.1.0",
author="<NAME>",
author_email="<EMAIL>",
description="GPU-accelerated multiview clustering and dimensionality reduction",
long_description=long_descrip... | none | 1 | 1.402467 | 1 | |
scripts/ebook_name_fix.py | mcxiaoke/python-labs | 7 | 6623218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2017-05-29 15:01:41
# @Last Modified by: mcxiaoke
# @Last Modified time: 2017-06-27 17:09:59
from __future__ import print_function
import sys
import os
import codecs
import re
import string
import shutil
from datetime import datetime
ISO_DA... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2017-05-29 15:01:41
# @Last Modified by: mcxiaoke
# @Last Modified time: 2017-06-27 17:09:59
from __future__ import print_function
import sys
import os
import codecs
import re
import string
import shutil
from datetime import datetime
ISO_DA... | en | 0.45803 | #!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: mcxiaoke # @Date: 2017-05-29 15:01:41 # @Last Modified by: mcxiaoke # @Last Modified time: 2017-06-27 17:09:59 #$%^&*()+,._[]{}<>?`【】《》:”‘,。?' 1. strip (xxx) at name start (Wiley Finance 019)Portfolio Theory and Performance Analysis.pdf 2. strip 2... | 2.763051 | 3 |
python/tests/unit/test_ledger_tls.py | DACH-NY/dazl-client | 0 | 6623219 | <reponame>DACH-NY/dazl-client<filename>python/tests/unit/test_ledger_tls.py<gh_stars>0
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from asyncio import sleep
from dazl import connect, testing
import pytest
from .config imp... | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from asyncio import sleep
from dazl import connect, testing
import pytest
from .config import daml_sdk_versions
@pytest.mark.asyncio
@pytest.mark.parametrize("daml_sdk_version... | en | 0.875815 | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # the result of this call is not particularly interesting; # we just need to make sure it doesn't crash | 1.851376 | 2 |
apps/jobs/migrations/0004_auto_20201028_1104.py | iamjackwachira/wwfh | 0 | 6623220 | # Generated by Django 3.1.2 on 2020-10-28 11:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('jobs', '0003_auto_20201028_1035'),
]
operations = [
migrations.RenameField(
model_name='jobpost',
old_name='regional_restric... | # Generated by Django 3.1.2 on 2020-10-28 11:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('jobs', '0003_auto_20201028_1035'),
]
operations = [
migrations.RenameField(
model_name='jobpost',
old_name='regional_restric... | en | 0.824272 | # Generated by Django 3.1.2 on 2020-10-28 11:04 | 1.540819 | 2 |
base/autoencoder.py | RichardLeeK/MachineLearning | 1 | 6623221 | from keras.layers import Input, Dense
from keras.models import Model
import numpy as np
encoding_dim = 32
input_img = Input(shape=(16384,))
encoded = Dense(encoding_dim, activation='relu')(input_img)
decoded = Dense(16384, activation='sigmoid')(encoded)
autoencoder = Model(input_img, decoded)
encoder = Model(input_... | from keras.layers import Input, Dense
from keras.models import Model
import numpy as np
encoding_dim = 32
input_img = Input(shape=(16384,))
encoded = Dense(encoding_dim, activation='relu')(input_img)
decoded = Dense(16384, activation='sigmoid')(encoded)
autoencoder = Model(input_img, decoded)
encoder = Model(input_... | en | 0.425148 | from keras.datasets import mnist import numpy as np (x, _), (x2, _) = mnist.load_data() x = x[:10] x2 = x2[:10] x = x.astype('float32')/255 x2 = x2.astype('float32')/255 x = x.reshape((len(x), np.prod(x.shape[1:]))) x2 = x2.reshape((len(x2), np.prod(x2.shape[1:]))) print (x.shape) print(x2.shape) autoencoder.fit(x, ... | 2.639742 | 3 |
utils/download.py | IanDesuyo/AIKyaru | 11 | 6623222 | <filename>utils/download.py<gh_stars>10-100
import logging
from aiofile import async_open
import aiohttp
import re
import json
import os
import brotli
HEADER = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
}
async def rank() -... | <filename>utils/download.py<gh_stars>10-100
import logging
from aiofile import async_open
import aiohttp
import re
import json
import os
import brotli
HEADER = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
}
async def rank() -... | en | 0.710662 | Download google sheet and convert to a dict. Args: key (str): Between the slashes after spreadsheets/d. gid (str): The gid value at query. sql (str, optional): Query sql. Defaults to "select%20*". Raises: e: Exceptions caused by ClientSession. Returns: A converted ... | 2.638176 | 3 |
QuestionsBidding/bidding/admin.py | Athi223/Questions-Bidding | 0 | 6623223 | from django.contrib import admin
from .models import Question, Allotment
import json
import random
# Register your models here.
admin.site.register(Question)
@admin.register(Allotment)
class AllotmentAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
allotments = {}
for i in range(int(for... | from django.contrib import admin
from .models import Question, Allotment
import json
import random
# Register your models here.
admin.site.register(Question)
@admin.register(Allotment)
class AllotmentAdmin(admin.ModelAdmin):
def save_model(self, request, obj, form, change):
allotments = {}
for i in range(int(for... | en | 0.968259 | # Register your models here. | 2.192819 | 2 |
rta.py | fact-project/rta_frontend | 1 | 6623224 | <reponame>fact-project/rta_frontend
from flask import Flask
from flask import render_template, Response, request
from datetime import datetime
import lightcurve
from dateutil import parser
from dateutil.relativedelta import relativedelta
app = Flask(__name__)
def _make_response_for_invalid_request(message):
retu... | from flask import Flask
from flask import render_template, Response, request
from datetime import datetime
import lightcurve
from dateutil import parser
from dateutil.relativedelta import relativedelta
app = Flask(__name__)
def _make_response_for_invalid_request(message):
return Response(
respons... | none | 1 | 2.409988 | 2 | |
tsl/datasets/prototypes/mixin.py | TorchSpatiotemporal/tsl | 4 | 6623225 | import numpy as np
import pandas as pd
from tsl.ops.dataframe import to_numpy
from . import checks
from ...typing import FrameArray
from ...utils.python_utils import ensure_list
class PandasParsingMixin:
def _parse_dataframe(self, df: pd.DataFrame, node_level: bool = True):
assert checks.is_datetime_lik... | import numpy as np
import pandas as pd
from tsl.ops.dataframe import to_numpy
from . import checks
from ...typing import FrameArray
from ...utils.python_utils import ensure_list
class PandasParsingMixin:
def _parse_dataframe(self, df: pd.DataFrame, node_level: bool = True):
assert checks.is_datetime_lik... | en | 0.737801 | # check shape equivalence # check shape equivalence Returns a DataFrame to indicate if dataset timestamps is holiday. See https://python-holidays.readthedocs.io/en/latest/ Args: country (str): country for which holidays have to be checked, e.g., "CH" for Switzerland. ... | 2.5037 | 3 |
testslide/import_profiler.py | Flameeyes/TestSlide | 0 | 6623226 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import time
class ImportedModule(object):
"""
A module that was imported with __import__.
"""
def __... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import time
class ImportedModule(object):
"""
A module that was imported with __import__.
"""
def __... | en | 0.800996 | #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. A module that was imported with __import__. How many seconds it took to import this module, minus all child imports. Exp... | 2.565533 | 3 |
companion/src/cycle.py | kreako/soklaki | 0 | 6623227 | <filename>companion/src/cycle.py
from datetime import date, timedelta
YEARS_6 = timedelta(days=6 * 365 + 1)
YEARS_9 = timedelta(days=9 * 365 + 2)
YEARS_12 = timedelta(days=12 * 365 + 3)
def estimate_cycle(birthdate, evaluation_date):
# First estimate scholar year of the evaluation
if evaluation_date.month >... | <filename>companion/src/cycle.py
from datetime import date, timedelta
YEARS_6 = timedelta(days=6 * 365 + 1)
YEARS_9 = timedelta(days=9 * 365 + 2)
YEARS_12 = timedelta(days=12 * 365 + 3)
def estimate_cycle(birthdate, evaluation_date):
# First estimate scholar year of the evaluation
if evaluation_date.month >... | en | 0.846065 | # First estimate scholar year of the evaluation # the date corresponding to the end of the year in the scholar year | 3.684935 | 4 |
wizzer/__init__.py | mabolhasani/wizzer | 0 | 6623228 | <reponame>mabolhasani/wizzer
#module file: __init__.py
"""This module is a wizard builder for setting up parameters
[ e.g. variable(s) / configuration(s) ] to run a service."""
| #module file: __init__.py
"""This module is a wizard builder for setting up parameters
[ e.g. variable(s) / configuration(s) ] to run a service.""" | en | 0.426073 | #module file: __init__.py This module is a wizard builder for setting up parameters [ e.g. variable(s) / configuration(s) ] to run a service. | 1.665951 | 2 |
vlm/param.py | woojeongjin/vokenization | 173 | 6623229 | <reponame>woojeongjin/vokenization
import argparse
def process_args():
parser = argparse.ArgumentParser()
# Datasets
parser.add_argument(
"--train_data_file", default=None, type=str,
help="The input training data file (a text file).")
parser.add_argument(
"--eval_data_file", d... | import argparse
def process_args():
parser = argparse.ArgumentParser()
# Datasets
parser.add_argument(
"--train_data_file", default=None, type=str,
help="The input training data file (a text file).")
parser.add_argument(
"--eval_data_file", default=None, type=str,
help... | en | 0.798648 | # Datasets # Data loader # Logging and Saving # Model types # MLM tasks # VLM related params # Batch Size and Training Steps # Optimizer # Distributed Training # Half Precision # Ablation Study | 2.803858 | 3 |
rough_work/test.py | ndey96/spiking-actor-critic | 1 | 6623230 | <gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
import nengo
import nengo_ocl
# define the model
with nengo.Network() as model:
stim = nengo.Node(np.sin)
a = nengo.Ensemble(100, 1)
b = nengo.Ensemble(100, 1)
nengo.Connection(stim, a)
nengo.Connection(a, b, function=lambda x: x**2)... | import numpy as np
import matplotlib.pyplot as plt
import nengo
import nengo_ocl
# define the model
with nengo.Network() as model:
stim = nengo.Node(np.sin)
a = nengo.Ensemble(100, 1)
b = nengo.Ensemble(100, 1)
nengo.Connection(stim, a)
nengo.Connection(a, b, function=lambda x: x**2)
probe_a =... | en | 0.101077 | # define the model # build and run the model # plot the results #plt.plot(sim.trange(), sim.data[probe_a]) #plt.plot(sim.trange(), sim.data[probe_b]) #plt.show() | 2.711178 | 3 |
chat/migrations/0002_auto_20190625_1304.py | lokesh1729/chatapp | 1 | 6623231 | # Generated by Django 2.0.13 on 2019-06-25 07:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('chat', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='participant',
old_name='room',
new... | # Generated by Django 2.0.13 on 2019-06-25 07:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('chat', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='participant',
old_name='room',
new... | en | 0.728945 | # Generated by Django 2.0.13 on 2019-06-25 07:34 | 1.828832 | 2 |
2019/day2/2.py | tomhel/AoC_2019 | 1 | 6623232 | <filename>2019/day2/2.py
#!/usr/bin/env python3
def execute(prog):
pc = 0
while True:
op = prog[pc]
if op == 1:
r = prog[prog[pc + 1]] + prog[prog[pc + 2]]
prog[prog[pc + 3]] = r
pc += 4
elif op == 2:
r = prog[prog[pc + 1]] * prog[prog[... | <filename>2019/day2/2.py
#!/usr/bin/env python3
def execute(prog):
pc = 0
while True:
op = prog[pc]
if op == 1:
r = prog[prog[pc + 1]] + prog[prog[pc + 2]]
prog[prog[pc + 3]] = r
pc += 4
elif op == 2:
r = prog[prog[pc + 1]] * prog[prog[... | fr | 0.221828 | #!/usr/bin/env python3 | 3.467883 | 3 |
config.py | SnewbieChen/YunWeiBlog | 1 | 6623233 | # -*- coding: utf-8 -*-
# @Author : YunWei.Chen
# @Site : https://chen.yunwei.space
import os
import datetime
class Config:
DEBUG = False # 是否开启调试模式
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://yunwei:chen@yunwei#space@localhost/myspace' # 数据库URI
SECRET_KEY = 'Chen@YunWei#Space->Blog' # session加密密钥
... | # -*- coding: utf-8 -*-
# @Author : YunWei.Chen
# @Site : https://chen.yunwei.space
import os
import datetime
class Config:
DEBUG = False # 是否开启调试模式
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://yunwei:chen@yunwei#space@localhost/myspace' # 数据库URI
SECRET_KEY = 'Chen@YunWei#Space->Blog' # session加密密钥
... | zh | 0.636533 | # -*- coding: utf-8 -*- # @Author : YunWei.Chen # @Site : https://chen.yunwei.space # 是否开启调试模式 #space@localhost/myspace' # 数据库URI #Space->Blog' # session加密密钥 # 让JSON字符串显示中文 # 设置session过期时间为3天 # 文件保存文件夹名 # 文件上传目录 | 2.07028 | 2 |
app.py | rishabh99-rc/Student-Feedback-Sentimental-Analysis | 0 | 6623234 | <filename>app.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
import faculty
import drawFigure
from flask import Flask , render_template , redirect , request
app = Flask(__name__)
with open('feedback1.json') as file:
json_string = file.read()
documents1 = json.loads(js... | <filename>app.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
import faculty
import drawFigure
from flask import Flask , render_template , redirect , request
app = Flask(__name__)
with open('feedback1.json') as file:
json_string = file.read()
documents1 = json.loads(js... | none | 1 | 2.617895 | 3 | |
RASPI-stuff/python-codeline/Nokia5110/rpiMonitor.py | siliconchris1973/fairytale | 3 | 6623235 | <filename>RASPI-stuff/python-codeline/Nokia5110/rpiMonitor.py
#!/usr/bin/env python
import httplib, time, os, sys, json
import pcd8544.lcd as lcd
# class Process dedicated to process data get from Client
# and send information to LCD and console
class Process:
# Process constructor
def __init__(self):
# Initia... | <filename>RASPI-stuff/python-codeline/Nokia5110/rpiMonitor.py
#!/usr/bin/env python
import httplib, time, os, sys, json
import pcd8544.lcd as lcd
# class Process dedicated to process data get from Client
# and send information to LCD and console
class Process:
# Process constructor
def __init__(self):
# Initia... | en | 0.787954 | #!/usr/bin/env python # class Process dedicated to process data get from Client # and send information to LCD and console # Process constructor # Initialize LCD # Turn the backlight on # Parse data as json # Try to get data from json or return default value # Construct string to be displayed on screens # Also print str... | 3.168679 | 3 |
demo.py | sseemayer/msacounts | 1 | 6623236 | #!/usr/bin/env python
"""msacounts demo
Compile the C extensions using `python setup.py build_ext --inplace` before running this!
"""
import msacounts
import sys
import numpy as np
def main():
aln = msacounts.read_msa('data/1atzA.aln')
counts = msacounts.pair_counts(aln)
pwm = msacounts.pwm(counts)
... | #!/usr/bin/env python
"""msacounts demo
Compile the C extensions using `python setup.py build_ext --inplace` before running this!
"""
import msacounts
import sys
import numpy as np
def main():
aln = msacounts.read_msa('data/1atzA.aln')
counts = msacounts.pair_counts(aln)
pwm = msacounts.pwm(counts)
... | en | 0.443132 | #!/usr/bin/env python msacounts demo Compile the C extensions using `python setup.py build_ext --inplace` before running this! | 2.000182 | 2 |
scripts/shared_options.py | shaypal5/hollywood_crawler | 7 | 6623237 | <filename>scripts/shared_options.py
"""Shared holcrawl cli options."""
import click
_SHARED_OPTIONS = [
click.option('--verbose/--silent', default=True,
help="Turn printing progress to screen on or off.")
]
def _shared_options(func):
for option in reversed(_SHARED_OPTIONS):
func = op... | <filename>scripts/shared_options.py
"""Shared holcrawl cli options."""
import click
_SHARED_OPTIONS = [
click.option('--verbose/--silent', default=True,
help="Turn printing progress to screen on or off.")
]
def _shared_options(func):
for option in reversed(_SHARED_OPTIONS):
func = op... | en | 0.402392 | Shared holcrawl cli options. | 2.54079 | 3 |
Python/homework/hw03/my_gray_scaler.py | LucasChangcoding/USTC-2018-Smester-1 | 32 | 6623238 | from graphics import *
class MyGrayScaler(object):
# 构造函数, 注意 graphics 只支持 gif 和 ppm 格式的图片, 默认的图像文件名为 'color.gif'
def __init__(self, filename='color.gif'):
# 图像中心位于(200, 200)
self.img = Image(Point(200, 200), filename)
width = self.img.getWidth()
height = self.img.getHeight()
# 新建一个背景窗口, 长款分别为彩色图像的 2 倍
s... | from graphics import *
class MyGrayScaler(object):
# 构造函数, 注意 graphics 只支持 gif 和 ppm 格式的图片, 默认的图像文件名为 'color.gif'
def __init__(self, filename='color.gif'):
# 图像中心位于(200, 200)
self.img = Image(Point(200, 200), filename)
width = self.img.getWidth()
height = self.img.getHeight()
# 新建一个背景窗口, 长款分别为彩色图像的 2 倍
s... | zh | 0.995467 | # 构造函数, 注意 graphics 只支持 gif 和 ppm 格式的图片, 默认的图像文件名为 'color.gif' # 图像中心位于(200, 200) # 新建一个背景窗口, 长款分别为彩色图像的 2 倍 # 显示图像 # 先撤掉(可能)已经画过的图像 # 然后在背景窗口中画出 img # 进行灰度转换 # 根据公式进行灰度转换 # 设置提示 # 保存图像 # 创建对象 # 显示彩色图像 # 转换为灰度图 # 保存图像 | 3.299703 | 3 |
Rozdzial_1/r1_06.py | xinulsw/helion-python | 1 | 6623239 | <filename>Rozdzial_1/r1_06.py
# program r1_06.py
# Test modyfikacji obiektu typu list
list_object = [11, 22, 33, "A", "B", "C"]
print(f"Dla ID = {id(list_object)} wartość: {list_object}")
# Do obiektu możemy dodać wartość
list_object.append("Nowa")
print(f"Dla ID = {id(list_object)} wartość: {list_object}")
# lub zmie... | <filename>Rozdzial_1/r1_06.py
# program r1_06.py
# Test modyfikacji obiektu typu list
list_object = [11, 22, 33, "A", "B", "C"]
print(f"Dla ID = {id(list_object)} wartość: {list_object}")
# Do obiektu możemy dodać wartość
list_object.append("Nowa")
print(f"Dla ID = {id(list_object)} wartość: {list_object}")
# lub zmie... | pl | 0.999329 | # program r1_06.py # Test modyfikacji obiektu typu list # Do obiektu możemy dodać wartość # lub zmienić wartość w środku # Test modyfikacji obiektu typu dict # Do obiektu możemy dodać wartość # lub zmienić wartość w środku | 3.169746 | 3 |
python/vast/voidfinder/viz/load_results.py | DESI-UR/VoidFinder | 5 | 6623240 | <filename>python/vast/voidfinder/viz/load_results.py
import numpy
import h5py
from astropy.table import Table
import matplotlib
import matplotlib.pyplot as plt
#from vast.voidfinder.absmag_comovingdist_functions import Distance
from vast.voidfinder.distance import z_to_comoving_dist
from vast.voidfinder.preprocessing... | <filename>python/vast/voidfinder/viz/load_results.py
import numpy
import h5py
from astropy.table import Table
import matplotlib
import matplotlib.pyplot as plt
#from vast.voidfinder.absmag_comovingdist_functions import Distance
from vast.voidfinder.distance import z_to_comoving_dist
from vast.voidfinder.preprocessing... | de | 0.331728 | #from vast.voidfinder.absmag_comovingdist_functions import Distance # Constants #distance_metric = 'redshift' ############################################################################ # load hole locations # keys are 'x' 'y' 'z' 'radius' 'flag' #-----------------------------------------------------------------------... | 2.224967 | 2 |
Backend/Pozyx/pypozyx/structures/generic.py | osoc21/Safe-Crossing | 2 | 6623241 | <filename>Backend/Pozyx/pypozyx/structures/generic.py
#!/usr/bin/env python
# TODO move this in the RST files.
"""
pypozyx.structures.generic - introduces generic data structures derived from ByteStructure
Generic Structures
As the name implies, contains generic structures whose specific use is up to the
user. You sh... | <filename>Backend/Pozyx/pypozyx/structures/generic.py
#!/usr/bin/env python
# TODO move this in the RST files.
"""
pypozyx.structures.generic - introduces generic data structures derived from ByteStructure
Generic Structures
As the name implies, contains generic structures whose specific use is up to the
user. You sh... | en | 0.81027 | #!/usr/bin/env python # TODO move this in the RST files. pypozyx.structures.generic - introduces generic data structures derived from ByteStructure Generic Structures As the name implies, contains generic structures whose specific use is up to the user. You should use SingleRegister where applicable when reading/writ... | 2.331866 | 2 |
Protheus_WebApp/Modules/SIGAGTP/GTPA042TestCase.py | 98llm/tir-script-samples | 17 | 6623242 | from tir import Webapp
import unittest
class GTPA042(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup('SIGAGTP', '14/08/2020', 'T1', 'D MG 01 ')
inst.oHelper.Program('GTPA042')
# Efetua o cadastro de evento para envio de e-m... | from tir import Webapp
import unittest
class GTPA042(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup('SIGAGTP', '14/08/2020', 'T1', 'D MG 01 ')
inst.oHelper.Program('GTPA042')
# Efetua o cadastro de evento para envio de e-m... | es | 0.553952 | # Efetua o cadastro de evento para envio de e-mail | 2.524049 | 3 |
src/support/__init__.py | TauferLab/UrbanTrafficFramework_20 | 0 | 6623243 | from . import roadnet, simsio, utm, mappings, linkvolio, heatmap, emissions
| from . import roadnet, simsio, utm, mappings, linkvolio, heatmap, emissions
| none | 1 | 0.925337 | 1 | |
server/tests/base.py | ZoiksScoob/SimpleEvents | 1 | 6623244 | import json
from flask_testing import TestCase
from simple_events.app import app
from simple_events.models import db
class BaseTestCase(TestCase):
""" Base Tests """
def create_app(self):
app.config.from_object('simple_events.config.TestingConfig')
return app
def setUp(self):
db... | import json
from flask_testing import TestCase
from simple_events.app import app
from simple_events.models import db
class BaseTestCase(TestCase):
""" Base Tests """
def create_app(self):
app.config.from_object('simple_events.config.TestingConfig')
return app
def setUp(self):
db... | en | 0.806644 | Base Tests | 2.429068 | 2 |
fjord/settings/base.py | joshua-s/fjord | 0 | 6623245 | # This is your project's main settings file that can be committed to
# your repo. If you need to override a setting locally, use
# settings_local.py
from funfactory.settings_base import *
# Name of the top-level module where you put all your apps. If you
# did not install Playdoh with the funfactory installer scrip... | # This is your project's main settings file that can be committed to
# your repo. If you need to override a setting locally, use
# settings_local.py
from funfactory.settings_base import *
# Name of the top-level module where you put all your apps. If you
# did not install Playdoh with the funfactory installer scrip... | en | 0.823802 | # This is your project's main settings file that can be committed to # your repo. If you need to override a setting locally, use # settings_local.py # Name of the top-level module where you put all your apps. If you # did not install Playdoh with the funfactory installer script you may # need to edit this value. See t... | 1.598789 | 2 |
tests/test_utils.py | pauleveritt/wired_injector | 1 | 6623246 | from wired_injector.utils import caller_package, caller_module
def test_caller_package():
result = caller_package()
assert '_pytest' == result.__name__
def test_caller_module():
result = caller_module()
assert '_pytest.python' == result.__name__
| from wired_injector.utils import caller_package, caller_module
def test_caller_package():
result = caller_package()
assert '_pytest' == result.__name__
def test_caller_module():
result = caller_module()
assert '_pytest.python' == result.__name__
| none | 1 | 2.066433 | 2 | |
pca_utils.py | akashpalrecha/computational-linear-algebra | 1 | 6623247 | import torch
import torchvision
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D, proj3d
from matplotlib.patches import FancyArrowPatch
from datetime import datetime
from pdb import set_trace
MIN_16, MAX_16... | import torch
import torchvision
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D, proj3d
from matplotlib.patches import FancyArrowPatch
from datetime import datetime
from pdb import set_trace
MIN_16, MAX_16... | en | 0.696656 | # Convert to tensor, cuda, half precision # Make sure samples are rows and not columns # PCA Computations # Ignoring the complex part [:, 1] # Getting the top k eigen vectors # Reducing the matrix # def torchCov(x, rowvar=False, bias=False, ddof=None, aweights=None): # """Estimates covariance matrix like numpy.cov"... | 2.297537 | 2 |
kdbtest/__main__.py | SiMylo/kmel_db | 0 | 6623248 | <gh_stars>0
"""Python's unittest main entry point, extended to include coverage"""
import os
import sys
import unittest
try:
import coverage
HAVE_COVERAGE = True
except ImportError:
HAVE_COVERAGE = False
if sys.argv[0].endswith("__main__.py"):
# We change sys.argv[0] to make help message more useful
... | """Python's unittest main entry point, extended to include coverage"""
import os
import sys
import unittest
try:
import coverage
HAVE_COVERAGE = True
except ImportError:
HAVE_COVERAGE = False
if sys.argv[0].endswith("__main__.py"):
# We change sys.argv[0] to make help message more useful
# use ex... | en | 0.887393 | Python's unittest main entry point, extended to include coverage # We change sys.argv[0] to make help message more useful # use executable without path, unquoted # (it's just a hint anyway) # (if you have spaces in your executable you get what you deserve!) | 2.448614 | 2 |
app/views/product.py | LP-Dev-Web/LeBonRecoin | 0 | 6623249 | <gh_stars>0
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponseRedirect
from django.urls import reverse_lazy
from django.views.generic import (
DetailView,
RedirectView,
CreateView,
UpdateView,
DeleteView,
ListVie... | from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponseRedirect
from django.urls import reverse_lazy
from django.views.generic import (
DetailView,
RedirectView,
CreateView,
UpdateView,
DeleteView,
ListView,
)
from dj... | none | 1 | 2.136909 | 2 | |
AutoRegression.py | sercangul/AutoMachineLearning | 0 | 6623250 | <reponame>sercangul/AutoMachineLearning<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# This notebook explains the steps to develop an Automated Supervised Machine Learning Regression program, which automatically tunes the hyperparameters and prints out the final accuracy results as a tables together with feature i... | #!/usr/bin/env python
# coding: utf-8
# This notebook explains the steps to develop an Automated Supervised Machine Learning Regression program, which automatically tunes the hyperparameters and prints out the final accuracy results as a tables together with feature importance results.
# Let's import all libraries.
... | en | 0.739494 | #!/usr/bin/env python # coding: utf-8 # This notebook explains the steps to develop an Automated Supervised Machine Learning Regression program, which automatically tunes the hyperparameters and prints out the final accuracy results as a tables together with feature importance results. # Let's import all libraries. # I... | 3.557041 | 4 |