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 |
|---|---|---|---|---|---|---|---|---|---|---|
changes/buildsteps/lxc.py | bowlofstew/changes | 0 | 7000 | from __future__ import absolute_import
from changes.buildsteps.default import DefaultBuildStep
class LXCBuildStep(DefaultBuildStep):
"""
Similar to the default build step, except that it runs the client using
the LXC adapter.
"""
def can_snapshot(self):
return True
def get_label(self... | from __future__ import absolute_import
from changes.buildsteps.default import DefaultBuildStep
class LXCBuildStep(DefaultBuildStep):
"""
Similar to the default build step, except that it runs the client using
the LXC adapter.
"""
def can_snapshot(self):
return True
def get_label(self... | en | 0.800975 | Similar to the default build step, except that it runs the client using the LXC adapter. | 2.354675 | 2 |
swapidemo1.py | anvytran-dev/mycode | 0 | 7001 | <gh_stars>0
#!/usr/bin/env python3
"""Star Wars API HTTP response parsing"""
# requests is used to send HTTP requests (get it?)
import requests
URL= "https://swapi.dev/api/people/1"
def main():
"""sending GET request, checking response"""
# SWAPI response is stored in "resp" object
resp= requests.get(UR... | #!/usr/bin/env python3
"""Star Wars API HTTP response parsing"""
# requests is used to send HTTP requests (get it?)
import requests
URL= "https://swapi.dev/api/people/1"
def main():
"""sending GET request, checking response"""
# SWAPI response is stored in "resp" object
resp= requests.get(URL)
# wh... | en | 0.837581 | #!/usr/bin/env python3 Star Wars API HTTP response parsing # requests is used to send HTTP requests (get it?) sending GET request, checking response # SWAPI response is stored in "resp" object # what kind of python object is "resp"? # what can we do with it? | 3.719864 | 4 |
src/biota_models/vegetation/model/constants_json_create.py | Deltares/NBSDynamics | 2 | 7002 | <reponame>Deltares/NBSDynamics
import json
schema = {
"Spartina": {
"ColStart": "2000-04-01",
"ColEnd": "2000-05-31",
"random": 7,
"mud_colonization": [0.0, 0.0],
"fl_dr": 0.005,
"Maximum age": 20,
"Number LifeStages": 2,
"initial root length": 0.05,
... | import json
schema = {
"Spartina": {
"ColStart": "2000-04-01",
"ColEnd": "2000-05-31",
"random": 7,
"mud_colonization": [0.0, 0.0],
"fl_dr": 0.005,
"Maximum age": 20,
"Number LifeStages": 2,
"initial root length": 0.05,
"initial shoot length":... | en | 0.494133 | # 3.5. number of stems per m2 # 3.6. initial colonization fraction (0-1) # 3.7. drag coefficient # 3.9. dessication mortality threshold # 3.10. dessication mortality slope # 3.11. flooding mortality threshold # 3.12. flooding mortality slope # 3.13. flow velocity threshold # 3.14. flow velocity slope # 3.15 max height... | 1.640517 | 2 |
format/format.bzl | harshad-deo/TorchVI | 0 | 7003 | def _replace_formatted(ctx, manifest, files):
out = ctx.actions.declare_file(ctx.label.name)
# this makes it easier to add variables
file_lines = [
"""#!/bin/bash -e
WORKSPACE_ROOT="${1:-$BUILD_WORKSPACE_DIRECTORY}" """,
"""RUNPATH="${TEST_SRCDIR-$0.runfiles}"/""" + ctx.workspace_name,
... | def _replace_formatted(ctx, manifest, files):
out = ctx.actions.declare_file(ctx.label.name)
# this makes it easier to add variables
file_lines = [
"""#!/bin/bash -e
WORKSPACE_ROOT="${1:-$BUILD_WORKSPACE_DIRECTORY}" """,
"""RUNPATH="${TEST_SRCDIR-$0.runfiles}"/""" + ctx.workspace_name,
... | en | 0.338632 | # this makes it easier to add variables #!/bin/bash -e WORKSPACE_ROOT="${1:-$BUILD_WORKSPACE_DIRECTORY}" RUNPATH="${TEST_SRCDIR-$0.runfiles}"/ RUNPATH=(${RUNPATH//bin/ }) RUNPATH="${RUNPATH[0]}"bin echo $WORKSPACE_ROOT echo $RUNPATH while read original formatted; do if [[ ! -z "$original" ]] && [[ ! -z "$formatted"... | 2.356383 | 2 |
Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/2.Custom-User-Model/auth_demo/accounts/models.py | GunnerJnr/_CodeInstitute | 4 | 7004 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from django.utils import timezone
# Create your models here.
# Create our new user class
class AccountUserManager(UserManager):
def _create_user(self, usern... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from django.utils import timezone
# Create your models here.
# Create our new user class
class AccountUserManager(UserManager):
def _create_user(self, usern... | en | 0.823638 | # -*- coding: utf-8 -*- # Create your models here. # Create our new user class Creates and saves a User with the given username, email and password. :param username: :param email: :param password: :param is_staff: :param is_supervisor: :param extra_fields: :return... | 2.977339 | 3 |
histoGAN.py | mahmoudnafifi/HistoGAN | 169 | 7005 | <filename>histoGAN.py
"""
If you find this code useful, please cite our paper:
<NAME>, <NAME>, and <NAME>. "HistoGAN:
Controlling Colors of GAN-Generated and Real Images via Color Histograms."
In CVPR, 2021.
@inproceedings{afifi2021histogan,
title={Histo{GAN}: Controlling Colors of {GAN}-Generated and Real Ima... | <filename>histoGAN.py
"""
If you find this code useful, please cite our paper:
<NAME>, <NAME>, and <NAME>. "HistoGAN:
Controlling Colors of GAN-Generated and Real Images via Color Histograms."
In CVPR, 2021.
@inproceedings{afifi2021histogan,
title={Histo{GAN}: Controlling Colors of {GAN}-Generated and Real Ima... | en | 0.57044 | If you find this code useful, please cite our paper: <NAME>, <NAME>, and <NAME>. "HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms." In CVPR, 2021. @inproceedings{afifi2021histogan, title={Histo{GAN}: Controlling Colors of {GAN}-Generated and Real Images via Color Histograms}... | 2.020633 | 2 |
apps/careeropportunity/migrations/0003_careeropportunity_deadline.py | Kpaubert/onlineweb4 | 32 | 7006 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-05 18:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("careeropportunity", "0002_careeropportunity_job_type")]
operations = [
migrations.AddFie... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-05 18:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("careeropportunity", "0002_careeropportunity_job_type")]
operations = [
migrations.AddFie... | en | 0.812002 | # -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-05 18:52 | 1.515199 | 2 |
benchmark/python/ffi/benchmark_ffi.py | grygielski/incubator-mxnet | 211 | 7007 | <filename>benchmark/python/ffi/benchmark_ffi.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | <filename>benchmark/python/ffi/benchmark_ffi.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | en | 0.847853 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 2.066699 | 2 |
first-floor.py | levabd/smart-climat-daemon | 0 | 7008 | #!/usr/bin/env python3
import json
import argparse
import re
import datetime
import paramiko
import requests
# cmd ['ssh', 'smart',
# 'mkdir -p /home/levabd/smart-home-temp-humidity-monitor;
# cat - > /home/levabd/smart-home-temp-humidity-monitor/lr.json']
from miio import chuangmi_plug
from btlewrap import availabl... | #!/usr/bin/env python3
import json
import argparse
import re
import datetime
import paramiko
import requests
# cmd ['ssh', 'smart',
# 'mkdir -p /home/levabd/smart-home-temp-humidity-monitor;
# cat - > /home/levabd/smart-home-temp-humidity-monitor/lr.json']
from miio import chuangmi_plug
from btlewrap import availabl... | en | 0.76926 | #!/usr/bin/env python3 # cmd ['ssh', 'smart', # 'mkdir -p /home/levabd/smart-home-temp-humidity-monitor; # cat - > /home/levabd/smart-home-temp-humidity-monitor/lr.json'] Check for valid mac addresses. Turn on humidifier on a first floor. Turn off humidifier on a first floor. Check if AC is turned off. Check if AC is t... | 2.296182 | 2 |
reservior_classification.py | Optimist-Prime/QML-for-MNIST-classification | 1 | 7009 | <reponame>Optimist-Prime/QML-for-MNIST-classification
import pickle
from sklearn.neural_network import MLPClassifier
train = pickle.load(open('train_pca_reservoir_output_200samples.pickle','rb'))
test = pickle.load(open('test_pca_reservoir_output_50samples.pickle','rb'))
train_num = 200
test_num = 50
mlp = MLPClassi... | import pickle
from sklearn.neural_network import MLPClassifier
train = pickle.load(open('train_pca_reservoir_output_200samples.pickle','rb'))
test = pickle.load(open('test_pca_reservoir_output_50samples.pickle','rb'))
train_num = 200
test_num = 50
mlp = MLPClassifier(hidden_layer_sizes=(2000,), max_iter=100, alpha=1... | none | 1 | 2.9387 | 3 | |
util.py | delmarrerikaine/LPG-PCA | 1 | 7010 | <filename>util.py
import numpy as np
import pandas as pd
from skimage import io
import skimage.measure as measure
import os
from lpg_pca_impl import denoise
def getNoisedImage(originalImage, variance):
# return random_noise(originalImage, mode='gaussian', var=variance)
np.random.seed(42)
noise = np.random... | <filename>util.py
import numpy as np
import pandas as pd
from skimage import io
import skimage.measure as measure
import os
from lpg_pca_impl import denoise
def getNoisedImage(originalImage, variance):
# return random_noise(originalImage, mode='gaussian', var=variance)
np.random.seed(42)
noise = np.random... | en | 0.436875 | # return random_noise(originalImage, mode='gaussian', var=variance) | 2.491104 | 2 |
ui/ui.py | kringen/wingnut | 0 | 7011 | <filename>ui/ui.py
import redis
from rq import Queue, Connection
from flask import Flask, render_template, Blueprint, jsonify, request
import tasks
import rq_dashboard
from wingnut import Wingnut
app = Flask(
__name__,
template_folder="./templates",
static_folder="./static",
)
app.config.f... | <filename>ui/ui.py
import redis
from rq import Queue, Connection
from flask import Flask, render_template, Blueprint, jsonify, request
import tasks
import rq_dashboard
from wingnut import Wingnut
app = Flask(
__name__,
template_folder="./templates",
static_folder="./static",
)
app.config.f... | none | 1 | 2.350671 | 2 | |
pytaboola/__init__.py | Openmail/pytaboola | 0 | 7012 | <reponame>Openmail/pytaboola<filename>pytaboola/__init__.py<gh_stars>0
from pytaboola.client import TaboolaClient | from pytaboola.client import TaboolaClient | none | 1 | 1.019376 | 1 | |
omkar/code.py | omi28/ga-learner-dst-repo | 0 | 7013 | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#New record
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
data.shape
cenus=np.concatenate((new_record,data),axis=0)
cenus.... | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#New record
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
data.shape
cenus=np.concatenate((new_record,data),axis=0)
cenus.... | en | 0.699388 | # -------------- # Importing header files #New record #Reading file #high=education_num[high] #low=education_num[low] #Code starts here | 2.822757 | 3 |
test/present.py | jchampio/apache-websocket | 8 | 7014 | <reponame>jchampio/apache-websocket<filename>test/present.py
#! /usr/bin/env python
#
# Presents the results of an Autobahn TestSuite run in TAP format.
#
# 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 ... | #! /usr/bin/env python
#
# Presents the results of an Autobahn TestSuite run in TAP format.
#
# 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... | en | 0.815923 | #! /usr/bin/env python # # Presents the results of an Autobahn TestSuite run in TAP format. # # 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... | 2.487012 | 2 |
softwarecollections/scls/migrations/0004_other_repos_default_values.py | WEBZCC/softwarecollections | 39 | 7015 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scls', '0003_other_repos'),
]
operations = [
migrations.AlterField(
model_name='otherrepo',
name='ar... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scls', '0003_other_repos'),
]
operations = [
migrations.AlterField(
model_name='otherrepo',
name='ar... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.539476 | 2 |
python/Excel/enumerateCells.py | davidgjy/arch-lib | 0 | 7016 | <filename>python/Excel/enumerateCells.py<gh_stars>0
import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
rows = sheet.get_highest_row()
cols = sheet.get_highest_column()
for i in range(1, rows + 1):
for j in range(1, cols + 1):
print('%s: %s' % (sheet.cell(row=i... | <filename>python/Excel/enumerateCells.py<gh_stars>0
import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
rows = sheet.get_highest_row()
cols = sheet.get_highest_column()
for i in range(1, rows + 1):
for j in range(1, cols + 1):
print('%s: %s' % (sheet.cell(row=i... | none | 1 | 3.335258 | 3 | |
plugins/polio/migrations/0029_campaign_country.py | BLSQ/iaso-copy | 29 | 7017 | <filename>plugins/polio/migrations/0029_campaign_country.py
# Generated by Django 3.1.13 on 2021-10-04 11:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("iaso", "0107_auto_20211001_1845"),
("polio", "0028_remo... | <filename>plugins/polio/migrations/0029_campaign_country.py
# Generated by Django 3.1.13 on 2021-10-04 11:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("iaso", "0107_auto_20211001_1845"),
("polio", "0028_remo... | en | 0.827152 | # Generated by Django 3.1.13 on 2021-10-04 11:44 | 1.607852 | 2 |
CurrencyExchange.py | aarana14/CurrencyExchange | 0 | 7018 | #import external libraries used in code
import requests, json
import pycountry
print('Currency Exchange')
currencies = []
def findCurrency():
#Finds all avaliable currencies
allCurrency = (list(pycountry.currencies))
for x in allCurrency:
y = str(x)
y = y[18:21]
#Adds th... | #import external libraries used in code
import requests, json
import pycountry
print('Currency Exchange')
currencies = []
def findCurrency():
#Finds all avaliable currencies
allCurrency = (list(pycountry.currencies))
for x in allCurrency:
y = str(x)
y = y[18:21]
#Adds th... | en | 0.849323 | #import external libraries used in code #Finds all avaliable currencies #Adds the value of their ISO to the "currencies" list #Organizes all values in "currency" list #Allows up to 26 ISOs to be in one line #Displays all currency ISOs to user #Ask user if they need help #If user inputs "?" run help procedure #Display i... | 3.820142 | 4 |
atcoder/corp/codethxfes2014a_e.py | knuu/competitive-programming | 1 | 7019 | <gh_stars>1-10
r, c, m = map(int, input().split())
n = int(input())
op = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
board = [[0 for _ in range(c)] for _ in range(r)]
for ra, rb, ca, cb in op:
for j in range(ra, rb + 1):
for k in range(ca, cb + 1):
board[j][k] += 1
cnt ... | r, c, m = map(int, input().split())
n = int(input())
op = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
board = [[0 for _ in range(c)] for _ in range(r)]
for ra, rb, ca, cb in op:
for j in range(ra, rb + 1):
for k in range(ca, cb + 1):
board[j][k] += 1
cnt = 0
for i in ra... | none | 1 | 2.686714 | 3 | |
scripts/analyse_bse.py | QU-XIAO/yambopy | 21 | 7020 | # Copyright (C) 2018 <NAME>, <NAME>
# All rights reserved.
#
# This file is part of yambopy
#
from __future__ import print_function
from builtins import range
from yambopy import *
from qepy import *
import json
import matplotlib.pyplot as plt
import numpy as np
import sys
import argparse
import operator
def analyse_b... | # Copyright (C) 2018 <NAME>, <NAME>
# All rights reserved.
#
# This file is part of yambopy
#
from __future__ import print_function
from builtins import range
from yambopy import *
from qepy import *
import json
import matplotlib.pyplot as plt
import numpy as np
import sys
import argparse
import operator
def analyse_b... | en | 0.726461 | # Copyright (C) 2018 <NAME>, <NAME> # All rights reserved. # # This file is part of yambopy # Using ypp, you can study the convergence of BSE calculations in 2 ways: Create a .png of all absorption spectra relevant to the variable you study Look at the eigenvalues of the first n "bright" excitons (given a t... | 2.866479 | 3 |
halmodule.py | richteer/pyfatafl | 0 | 7021 | <reponame>richteer/pyfatafl<gh_stars>0
from module import XMPPModule
import halutils
import pyfatafl
class Game():
self.players = []
self.xmpp = None
self.b = None
self.turn = ""
self.mod = None
def __init__(self, mod, p1, p2):
self.players = [p1, p2]
self.mod = mod
self.xmpp = mod.xmpp
self.xmpp.sendMs... | from module import XMPPModule
import halutils
import pyfatafl
class Game():
self.players = []
self.xmpp = None
self.b = None
self.turn = ""
self.mod = None
def __init__(self, mod, p1, p2):
self.players = [p1, p2]
self.mod = mod
self.xmpp = mod.xmpp
self.xmpp.sendMsg(p2, "You have been challenged to play... | en | 0.789886 | # Send initial board state # For now, make the challenger be first # TODO: Have been errors # Commented to avoid loading before its ready # TODO: Validate JID here usage: !hnefatafl <command> [arg] Commands: challenge <jid> - Send a challenge to JID accept - Accept a challenge from JID, and begin game su... | 2.867681 | 3 |
tools/acetz.py | arkhipenko/AceTime | 1 | 7022 | <gh_stars>1-10
from typing import cast, Optional
from datetime import datetime, tzinfo, timedelta
from zonedbpy import zone_infos
from zone_processor.zone_specifier import ZoneSpecifier
from zone_processor.inline_zone_info import ZoneInfo
__version__ = '1.1'
class acetz(tzinfo):
"""An implementation of datetime.... | from typing import cast, Optional
from datetime import datetime, tzinfo, timedelta
from zonedbpy import zone_infos
from zone_processor.zone_specifier import ZoneSpecifier
from zone_processor.inline_zone_info import ZoneInfo
__version__ = '1.1'
class acetz(tzinfo):
"""An implementation of datetime.tzinfo using th... | en | 0.517041 | An implementation of datetime.tzinfo using the ZoneSpecifier class from AceTime/tools. | 2.97337 | 3 |
z2/part2/interactive/jm/random_fuzzy_arrows_1/554539540.py | kozakusek/ipp-2020-testy | 1 | 7023 | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 554539540
"""
"""
random actions, total chaos
"""
board = gamma_new(6, 8, 3, 17)
assert board i... | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 554539540
"""
"""
random actions, total chaos
"""
board = gamma_new(6, 8, 3, 17)
assert board i... | en | 0.357858 | scenario: test_random_actions uuid: 554539540 random actions, total chaos | 2.233623 | 2 |
examples/run_chemistry_parser.py | ZhuoyuWei/transformers | 0 | 7024 | <filename>examples/run_chemistry_parser.py<gh_stars>0
# coding=utf-8
# Copyright 2019 The HuggingFace Inc. team.
# Copyright (c) 2019 The HuggingFace Inc. 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 ma... | <filename>examples/run_chemistry_parser.py<gh_stars>0
# coding=utf-8
# Copyright 2019 The HuggingFace Inc. team.
# Copyright (c) 2019 The HuggingFace Inc. 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 ma... | en | 0.474571 | # coding=utf-8 # Copyright 2019 The HuggingFace Inc. team. # Copyright (c) 2019 The HuggingFace Inc. 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.a... | 2.093359 | 2 |
envergo/geodata/management/commands/import_shapefiles.py | MTES-MCT/envergo | 0 | 7025 | from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils import LayerMapping
from django.core.management.base import BaseCommand
from envergo.geodata.models import Zone
class Command(BaseCommand):
help = "Importe des zones à partir de shapefiles."
def add_arguments(self, parser):
... | from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils import LayerMapping
from django.core.management.base import BaseCommand
from envergo.geodata.models import Zone
class Command(BaseCommand):
help = "Importe des zones à partir de shapefiles."
def add_arguments(self, parser):
... | none | 1 | 2.096691 | 2 | |
vimfiles/bundle/ultisnips/test/test_AnonymousExpansion.py | duanqiaobb/vim-for-java | 0 | 7026 | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Anonymous Expansion {{{#
class _AnonBase(_VimTest):
args = ''
def _extra_options_pre_init(self, vim_config):
vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>'
% (EA, se... | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Anonymous Expansion {{{#
class _AnonBase(_VimTest):
args = ''
def _extra_options_pre_init(self, vim_config):
vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>'
% (EA, se... | en | 0.639851 | # Anonymous Expansion {{{# #Anon(%s)<cr>' # End: Anonymous Expansion #}}} | 2.07212 | 2 |
data_converter/data_converter.py | jkchen2/JshBot-plugins | 1 | 7027 | import discord
from jshbot import utilities, data, configurations, plugins, logger
from jshbot.exceptions import BotException, ConfiguredBotException
from jshbot.commands import (
Command, SubCommand, Shortcut, ArgTypes, Attachment, Arg, Opt, MessageTypes, Response)
__version__ = '0.1.0'
CBException = ConfiguredB... | import discord
from jshbot import utilities, data, configurations, plugins, logger
from jshbot.exceptions import BotException, ConfiguredBotException
from jshbot.commands import (
Command, SubCommand, Shortcut, ArgTypes, Attachment, Arg, Opt, MessageTypes, Response)
__version__ = '0.1.0'
CBException = ConfiguredB... | en | 0.518012 | # TODO: Iterate through toggled commands #key,value,length,volume,name,flags,author,hits,created,last_used,last_used_by,complex,extra # key # value # length # volume # name # flags # author # hits # created # last_used # last_used_by # complex # extra | 2.172792 | 2 |
tut2.py | ankit98040/TKINTER-JIS | 0 | 7028 | from tkinter import *
from PIL import Image, ImageTk
#python image library
#imagetk supports jpg image
a1 = Tk()
a1.geometry("455x244")
#for png image
#photo = PhotoImage(file="filename.png")
#a2 = Label(image = photo)
#a2.pack()
image = Image.open("PJXlVd.jpg")
photo = ImageTk.PhotoImage(image)
... | from tkinter import *
from PIL import Image, ImageTk
#python image library
#imagetk supports jpg image
a1 = Tk()
a1.geometry("455x244")
#for png image
#photo = PhotoImage(file="filename.png")
#a2 = Label(image = photo)
#a2.pack()
image = Image.open("PJXlVd.jpg")
photo = ImageTk.PhotoImage(image)
... | en | 0.305706 | #python image library #imagetk supports jpg image #for png image #photo = PhotoImage(file="filename.png") #a2 = Label(image = photo) #a2.pack() | 3.3377 | 3 |
dataset.py | mintanwei/IPCLs-Net | 0 | 7029 | import os
import torch
from PIL import Image
from read_csv import csv_to_label_and_bbx
import numpy as np
from torch.utils.data import Subset, random_split, ConcatDataset
class NBIDataset(object):
def __init__(self, root, transforms, nob3=False):
self.root = root
self.transforms = transforms
... | import os
import torch
from PIL import Image
from read_csv import csv_to_label_and_bbx
import numpy as np
from torch.utils.data import Subset, random_split, ConcatDataset
class NBIDataset(object):
def __init__(self, root, transforms, nob3=False):
self.root = root
self.transforms = transforms
... | en | 0.54188 | # load all image files, sorting them to ensure that they are aligned # FloatTensor[N, 4] # Int64Tensor[N] # target["image_path"] = img_path # target = self.transforms(target) # FloatTensor[N, 4] # Int64Tensor[N] # target["image_path"] = img_path # target = self.transforms(target) # FloatTensor[N, 4] # Int64Tensor[N] # ... | 2.629596 | 3 |
design_patterns/chapter5/mymath.py | FeliciaMJ/PythonLearningJourney | 0 | 7030 | # coding: utf-8
import functools
def memoize(fn):
known = dict()
@functools.wraps(fn)
def memoizer(*args):
if args not in known:
known[args] = fn(*args)
return known[args]
return memoizer
@memoize
def nsum(n):
'''返回前n个数字的和'''
assert(n >= 0), 'n must be >= 0'
... | # coding: utf-8
import functools
def memoize(fn):
known = dict()
@functools.wraps(fn)
def memoizer(*args):
if args not in known:
known[args] = fn(*args)
return known[args]
return memoizer
@memoize
def nsum(n):
'''返回前n个数字的和'''
assert(n >= 0), 'n must be >= 0'
... | zh | 0.814043 | # coding: utf-8 返回前n个数字的和 返回斐波那契数列的第n个数 | 2.786743 | 3 |
transforms/__init__.py | yangyuke001/emotion-expression.shufflenetv2 | 3 | 7031 | <reponame>yangyuke001/emotion-expression.shufflenetv2
from .transforms import *
| from .transforms import * | none | 1 | 1.149386 | 1 | |
codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py | adRenaud/research | 1 | 7032 | <filename>codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py
# !\usr\bin\python
import numpy as np
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import scipy.optimize
from matplotlib import animation
from scipy.integrate import ode
import pdb
# Material parameters
rh... | <filename>codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py
# !\usr\bin\python
import numpy as np
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import scipy.optimize
from matplotlib import animation
from scipy.integrate import ode
import pdb
# Material parameters
rh... | en | 0.279623 | # !\usr\bin\python # Material parameters # |H1111 H1112 H1122| # H =|H1211 H1212 H1222| # |H2211 H2212 H2222| # sigma = [sig11 , sig12 , sig22 , sig33 ] ## Plane stress tangent modulus Hijkl = Hijkl - Hij33*H33kl/H3333 ## omega1,w1 associated to cf ## omega2,w2 associated to cs # T = [T11 T21 T22 T33] # deviatori... | 1.990196 | 2 |
pyhsms/core/connectionstate.py | cherish-web/pyhsms | 2 | 7033 | <reponame>cherish-web/pyhsms
# _*_ coding: utf-8 _*_
#@Time : 2020/7/29 上午 09:49
#@Author : cherish_peng
#@Email : <EMAIL>
#@File : connectionstate.py
#@Software : PyCharm
from enum import Enum
class ConnectionState(Enum):
'''
ConnectionState enum
'''
DisConnected = 0
Connecting=1
... | # _*_ coding: utf-8 _*_
#@Time : 2020/7/29 上午 09:49
#@Author : cherish_peng
#@Email : <EMAIL>
#@File : connectionstate.py
#@Software : PyCharm
from enum import Enum
class ConnectionState(Enum):
'''
ConnectionState enum
'''
DisConnected = 0
Connecting=1
Connected=2
Selected=... | zh | 0.251521 | # _*_ coding: utf-8 _*_ #@Time : 2020/7/29 上午 09:49 #@Author : cherish_peng #@Email : <EMAIL> #@File : connectionstate.py #@Software : PyCharm ConnectionState enum | 2.103431 | 2 |
lifelines/fitters/coxph_fitter.py | msanpe/lifelines | 0 | 7034 | # -*- coding: utf-8 -*-
import time
from datetime import datetime
import warnings
from textwrap import dedent, fill
import numpy as np
import pandas as pd
from numpy.linalg import norm, inv
from scipy.linalg import solve as spsolve, LinAlgError
from scipy.integrate import trapz
from scipy import stats
from lifelines.... | # -*- coding: utf-8 -*-
import time
from datetime import datetime
import warnings
from textwrap import dedent, fill
import numpy as np
import pandas as pd
from numpy.linalg import norm, inv
from scipy.linalg import solve as spsolve, LinAlgError
from scipy.integrate import trapz
from scipy import stats
from lifelines.... | en | 0.763461 | # -*- coding: utf-8 -*- # https://github.com/CamDavidsonPilon/lifelines/issues/591 for original issue. # new values from from perf/batch_vs_single script. This class implements fitting Cox's proportional hazard model: .. math:: h(t|x) = h_0(t) \exp((x - \overline{x})' \beta) Parameters ---------- ... | 1.726434 | 2 |
nlp_server/config/test/test_config.py | asevans48/NLPServer | 0 | 7035 | """
Test configuration loading
@author aevans
"""
import os
from nlp_server.config import load_config
def test_load_config():
"""
Test loading a configuration
"""
current_dir = os.path.curdir
test_path = os.path.sep.join([current_dir, 'data', 'test_config.json'])
cfg = load_config.load_conf... | """
Test configuration loading
@author aevans
"""
import os
from nlp_server.config import load_config
def test_load_config():
"""
Test loading a configuration
"""
current_dir = os.path.curdir
test_path = os.path.sep.join([current_dir, 'data', 'test_config.json'])
cfg = load_config.load_conf... | en | 0.376442 | Test configuration loading @author aevans Test loading a configuration | 2.478163 | 2 |
frappe/utils/safe_exec.py | ektai/frappe3 | 0 | 7036 |
import os, json, inspect
import mimetypes
from html2text import html2text
from RestrictedPython import compile_restricted, safe_globals
import RestrictedPython.Guards
import frappe
import frappe.utils
import frappe.utils.data
from frappe.website.utils import (get_shade, get_toc, get_next_link)
from frappe.modules impo... |
import os, json, inspect
import mimetypes
from html2text import html2text
from RestrictedPython import compile_restricted, safe_globals
import RestrictedPython.Guards
import frappe
import frappe.utils
import frappe.utils.data
from frappe.website.utils import (get_shade, get_toc, get_next_link)
from frappe.modules impo... | en | 0.716683 | # script reports must be enabled via site_config.json # build globals # execute script compiled by RestrictedPython # pylint: disable=exec-used # make available limited methods of frappe # default writer allows write access # allow iterators and list comprehension # guard function for RestrictedPython # allow any key t... | 2.082983 | 2 |
simplejson/ordered_dict.py | BarracudaPff/code-golf-data-pythpn | 0 | 7037 | <gh_stars>0
"""Drop-in replacement for collections.OrderedDict by <NAME>
http://code.activestate.com/recipes/576693/
"""
try:
all
except NameError:
def all(seq):
for elem in seq:
if not elem:
return False
return True
class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds):
if len(args) > 1... | """Drop-in replacement for collections.OrderedDict by <NAME>
http://code.activestate.com/recipes/576693/
"""
try:
all
except NameError:
def all(seq):
for elem in seq:
if not elem:
return False
return True
class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds):
if len(args) > 1:
raise T... | en | 0.736346 | Drop-in replacement for collections.OrderedDict by <NAME> http://code.activestate.com/recipes/576693/ | 2.691415 | 3 |
Water.py | KRHS-GameProgramming-2015/Adlez | 0 | 7038 | <reponame>KRHS-GameProgramming-2015/Adlez
from HardBlock import *
class Water(HardBlock):
def __init__(self, pos=[0,0], blockSize = 25):
image = "Block/Block Images/water.png"
HardBlock.__init__(self, image, pos, blockSize)
def update(*args):
pass
... | from HardBlock import *
class Water(HardBlock):
def __init__(self, pos=[0,0], blockSize = 25):
image = "Block/Block Images/water.png"
HardBlock.__init__(self, image, pos, blockSize)
def update(*args):
pass | none | 1 | 2.331129 | 2 | |
baselines/bc.py | bgalbraith/minerl-haiku-baselines | 2 | 7039 | <filename>baselines/bc.py<gh_stars>1-10
import dill
import haiku as hk
import jax
from jax.experimental import optix
import jax.numpy as jnp
from dataset import load_data
MINERL_ENV = 'MineRLTreechopVectorObf-v0'
PARAMS_FILENAME = 'bc_params_treechop.pkl'
class PovStack(hk.Module):
""" PovStack is a module for... | <filename>baselines/bc.py<gh_stars>1-10
import dill
import haiku as hk
import jax
from jax.experimental import optix
import jax.numpy as jnp
from dataset import load_data
MINERL_ENV = 'MineRLTreechopVectorObf-v0'
PARAMS_FILENAME = 'bc_params_treechop.pkl'
class PovStack(hk.Module):
""" PovStack is a module for... | en | 0.85924 | PovStack is a module for processing the point-of-view image data that comes from the agent's viewport. This input is in NHWC format for a shape of (N, 64, 64, 3). This model is inspired from https://github.com/minerllabs/baselines/blob/master/general/chainerrl/baselines/behavioral_cloning.py VectorStac... | 2.492736 | 2 |
qiskit/circuit/library/templates/__init__.py | ajavadia/qiskit-sdk-py | 15 | 7040 | <reponame>ajavadia/qiskit-sdk-py
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# A... | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | en | 0.854678 | # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo... | 1.656758 | 2 |
Tests/test_ironmath.py | btddg28/ironpython | 0 | 7041 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | en | 0.668951 | ##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th... | 2.003704 | 2 |
python/lib/viewer/gener_q_vs_w_for_df.py | timtyree/bgmc | 0 | 7042 | <reponame>timtyree/bgmc
import matplotlib.pyplot as plt, numpy as np, pandas as pd,os
from ..model import recall_powerlaw_fits_to_full_models
from .. import compute_power_rmse
from .bluf import *
from ..measure.powerlaw import *
from .gener_q_vs_w_for_result_folder import *
def q_vs_w_plotter_function_from_df(ax,df):
... | import matplotlib.pyplot as plt, numpy as np, pandas as pd,os
from ..model import recall_powerlaw_fits_to_full_models
from .. import compute_power_rmse
from .bluf import *
from ..measure.powerlaw import *
from .gener_q_vs_w_for_result_folder import *
def q_vs_w_plotter_function_from_df(ax,df):
# npartitions=os.cp... | en | 0.270712 | # npartitions=os.cpu_count() #5 # xlim=[-0.05,1.05] # ylim=[1e-1,20]#[1e-5,1e4] #extract column values #cm #cm^2/s #cm #cm^2 #1/s #1/s #1/s #TDOO: compute xy values #compute title= # title=r"$\nu$="+f"{m:.3f}, "+f"M={M:.3f}"+r" cm$^2$/s\n" # additional parameters optional/uncommentable... #DONE: plot the data #... | 2.242146 | 2 |
decatt/model.py | achyudh/castor | 132 | 7043 | import sys
import math
import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class DecAtt(nn.Module):
def __init__(self, num_units, num_classes, embedding_size, dropout, device=0,
training=True, p... | import sys
import math
import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class DecAtt(nn.Module):
def __init__(self, num_units, num_classes, embedding_size, dropout, device=0,
training=True, p... | en | 0.71053 | Create the model based on MLP networks. :param num_units: size of the networks :param num_classes: number of classes in the problem :param embedding_size: size of each word embedding :param use_intra_attention: whether to use intra-attention model :param training: whether to cre... | 3.02242 | 3 |
basic_code/networks.py | J-asy/Emotion-FAN | 275 | 7044 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch.nn.functional as F
import torch
import numpy as np
import cv2
import pdb
def sigmoid(x):
return 1 / (1 + math.exp(-x))
def norm_angle(angle):
norm_angle = sigmoid(10 * (abs(angle) / 0.7853975 - 1))
return norm_angle
... | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch.nn.functional as F
import torch
import numpy as np
import cv2
import pdb
def sigmoid(x):
return 1 / (1 + math.exp(-x))
def norm_angle(angle):
norm_angle = sigmoid(10 * (abs(angle) / 0.7853975 - 1))
return norm_angle
... | en | 0.586587 | ###''' self-attention; relation-attention ''' # x[128,3,224,224] # f[1, 512, 1, 1] ---> f[1, 512] # MN_MODEL(first Level) # f[1, 512, 1, 1] ---> f[1, 512] # MN_MODEL(first Level) # [381, 21783] -> [21783,381] * [381,512] --> [21783, 512] keywords: mean_fc ; weight_sourcefc; sum_alpha; weightmean_sourcefc alpha * beta #... | 2.808775 | 3 |
ndscheduler/server/handlers/index.py | symphonyrm/ndscheduler | 0 | 7045 | """Serves the single page app web ui."""
import json
import tornado.gen
from ndscheduler import settings
from ndscheduler import utils
from ndscheduler.server.handlers import base
class Handler(base.BaseHandler):
"""Index page request handler."""
@tornado.gen.coroutine
def get(self):
"""Serve u... | """Serves the single page app web ui."""
import json
import tornado.gen
from ndscheduler import settings
from ndscheduler import utils
from ndscheduler.server.handlers import base
class Handler(base.BaseHandler):
"""Index page request handler."""
@tornado.gen.coroutine
def get(self):
"""Serve u... | en | 0.646298 | Serves the single page app web ui. Index page request handler. Serve up the single page app for scheduler dashboard. | 2.122825 | 2 |
Scripts/xbbtools/xbb_io.py | eoc21/biopython | 3 | 7046 | #!/usr/bin/env python
# Created: Wed Jun 21 13:46:35 2000
# Last changed: Time-stamp: <00/12/02 14:18:23 thomas>
# <EMAIL>, http://evolution.bmc.uu.se/~thomas
# File: xbb_io.py
import os, sys # os.system, sys.argv
sys.path.insert(0, '.')
sys.path.insert(0, os.path.expanduser('~thomas/cbs/python/biopython'))
from Bio... | #!/usr/bin/env python
# Created: Wed Jun 21 13:46:35 2000
# Last changed: Time-stamp: <00/12/02 14:18:23 thomas>
# <EMAIL>, http://evolution.bmc.uu.se/~thomas
# File: xbb_io.py
import os, sys # os.system, sys.argv
sys.path.insert(0, '.')
sys.path.insert(0, os.path.expanduser('~thomas/cbs/python/biopython'))
from Bio... | en | 0.363968 | #!/usr/bin/env python # Created: Wed Jun 21 13:46:35 2000 # Last changed: Time-stamp: <00/12/02 14:18:23 thomas> # <EMAIL>, http://evolution.bmc.uu.se/~thomas # File: xbb_io.py # os.system, sys.argv | 2.560915 | 3 |
HW6/Andrii_Haponov/cw_4.py | kolyasalubov/Lv-677.PythonCore | 0 | 7047 | <reponame>kolyasalubov/Lv-677.PythonCore
# Convert a Number to a String!
# We need a function that can transform a number into a string.
# What ways of achieving this do you know?
def number_to_string(num: int) -> str:
str_num = str(num)
return str_num
print(number_to_string(123))
print(type(number_to_stri... | # Convert a Number to a String!
# We need a function that can transform a number into a string.
# What ways of achieving this do you know?
def number_to_string(num: int) -> str:
str_num = str(num)
return str_num
print(number_to_string(123))
print(type(number_to_string(123))) | en | 0.889416 | # Convert a Number to a String! # We need a function that can transform a number into a string. # What ways of achieving this do you know? | 4.064827 | 4 |
project/scripts/clausecat/evaluate_clausecat.py | explosion/healthsea | 60 | 7048 | import spacy
from spacy.scorer import PRFScore
import typer
from pathlib import Path
from wasabi import Printer, table
import operator
import benepar
import clausecat_component
import clausecat_model
import clausecat_reader
import clause_segmentation
import clause_aggregation
msg = Printer()
def main(model_path: Pa... | import spacy
from spacy.scorer import PRFScore
import typer
from pathlib import Path
from wasabi import Printer, table
import operator
import benepar
import clausecat_component
import clausecat_model
import clausecat_reader
import clause_segmentation
import clause_aggregation
msg = Printer()
def main(model_path: Pa... | en | 0.802506 | This script is used to evaluate the clausecat component # Prediction # Iterate through prediction and references # Add to matrix # Printing | 2.610034 | 3 |
utils/test.py | david-waugh/network-automation | 0 | 7049 | import pathlib
print(pathlib.Path(__file__).parent.resolve())
while True:
next_cmd = input("> ")
print(eval(next_cmd))
| import pathlib
print(pathlib.Path(__file__).parent.resolve())
while True:
next_cmd = input("> ")
print(eval(next_cmd))
| none | 1 | 2.298404 | 2 | |
nlp_annotator_api/server/app.py | IBM/deepsearch-nlp-annotator-api-example | 3 | 7050 | import logging
import os
import aiohttp.web
from connexion import AioHttpApp
from nlp_annotator_api.config.config import conf
from nlp_annotator_api.config.logging import setup_logging
from nlp_annotator_api.server.middleware.statsd_middleware import StatsdMiddleware
from nlp_annotator_api.server.signals.statsd_clien... | import logging
import os
import aiohttp.web
from connexion import AioHttpApp
from nlp_annotator_api.config.config import conf
from nlp_annotator_api.config.logging import setup_logging
from nlp_annotator_api.server.middleware.statsd_middleware import StatsdMiddleware
from nlp_annotator_api.server.signals.statsd_clien... | none | 1 | 2.029094 | 2 | |
keras_cv_attention_models/resnest/resnest.py | dcleres/keras_cv_attention_models | 140 | 7051 | <reponame>dcleres/keras_cv_attention_models
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from keras_cv_attention_models.aotnet import AotNet
from keras_cv_attention_models.download_and_load import reload_model_weights
from keras_cv_attention_models.attention_layers impo... | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from keras_cv_attention_models.aotnet import AotNet
from keras_cv_attention_models.download_and_load import reload_model_weights
from keras_cv_attention_models.attention_layers import batchnorm_with_activation, conv2d_no_bias... | en | 0.463198 | # nn = tf.transpose(nn, [0, 2, 1, 3]) # Using groups=2 is slow in `mixed_float16` policy # logits = conv2d_no_bias(inputs, filters * groups, kernel_size, padding="same", groups=groups, name=name and name + "1_") | 2.527709 | 3 |
dataactcore/migrations/versions/8692ab1298e1_replace_filerequest_with_filegeneration.py | brianherman/data-act-broker-backend | 1 | 7052 | <reponame>brianherman/data-act-broker-backend
"""replace FileRequest with FileGeneration
Revision ID: 8692ab1298e1
Revises: <KEY>
Create Date: 2018-10-24 14:54:39.278159
"""
# revision identifiers, used by Alembic.
revision = '8692ab1298e1'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
from alembic... | """replace FileRequest with FileGeneration
Revision ID: 8692ab1298e1
Revises: <KEY>
Create Date: 2018-10-24 14:54:39.278159
"""
# revision identifiers, used by Alembic.
revision = '8692ab1298e1'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgra... | en | 0.474628 | replace FileRequest with FileGeneration Revision ID: 8692ab1298e1 Revises: <KEY> Create Date: 2018-10-24 14:54:39.278159 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### DR... | 1.405514 | 1 |
cluster.py | Birfy/Endlinking | 1 | 7053 | import numpy as np
import random
import sys
chainlength = int(sys.argv[1])
dfname = sys.argv[2]
outfl = 'result.data'
cluster_size = int(sys.argv[3])
def readsize(dfname):
with open(dfname, 'r') as df:
lines = df.readlines()
for line in lines:
content = line.split()
if content and cont... | import numpy as np
import random
import sys
chainlength = int(sys.argv[1])
dfname = sys.argv[2]
outfl = 'result.data'
cluster_size = int(sys.argv[3])
def readsize(dfname):
with open(dfname, 'r') as df:
lines = df.readlines()
for line in lines:
content = line.split()
if content and cont... | en | 0.75552 | # print(content) # a boolean array that records which clusters are full # a list of objects who has been assigned to a cluster # list of objects ordered in asceding delta of the current # assignment and the best possible alternate assignment # keys = sorted(clusters.keys()) # i = 1 # for key in keys: # for obj in c... | 2.63266 | 3 |
ituro/accounts/tests.py | kayduemre/ituro | 9 | 7054 | from django.test import TestCase
from django.utils import timezone
from accounts.models import CustomUser, CustomUserManager
class UserCreateTestCase(TestCase):
def test_create_user_correctly(self):
"Creating users correctly"
new_user = CustomUser.objects.create(
email="<EMAIL>",
... | from django.test import TestCase
from django.utils import timezone
from accounts.models import CustomUser, CustomUserManager
class UserCreateTestCase(TestCase):
def test_create_user_correctly(self):
"Creating users correctly"
new_user = CustomUser.objects.create(
email="<EMAIL>",
... | none | 1 | 2.890749 | 3 | |
continuum/datasets/dtd.py | oleksost/continuum | 282 | 7055 | <filename>continuum/datasets/dtd.py
import os
from typing import List
import numpy as np
from torchvision import datasets as torchdata
from continuum.datasets import ImageFolderDataset
from continuum import download
from continuum.tasks import TaskType
class DTD(ImageFolderDataset):
"""Describable Textures Data... | <filename>continuum/datasets/dtd.py
import os
from typing import List
import numpy as np
from torchvision import datasets as torchdata
from continuum.datasets import ImageFolderDataset
from continuum import download
from continuum.tasks import TaskType
class DTD(ImageFolderDataset):
"""Describable Textures Data... | en | 0.717385 | Describable Textures Dataset (DTD) Reference: * Describing Textures in the Wild <NAME> and <NAME> and <NAME> and <NAME> and and <NAME> CVPR 2014 | 2.566559 | 3 |
src/tests/testdata.py | Doometnick/MaxiMin-2048 | 0 | 7056 | <filename>src/tests/testdata.py<gh_stars>0
from board import Direction
# Tuples of input, action, expected output.
moving_tests = [
(
[[0,0,0,0],
[4,0,0,0],
[0,0,0,0],
[4,0,2,0]],
Direction.UP,
[[8,0,2,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0... | <filename>src/tests/testdata.py<gh_stars>0
from board import Direction
# Tuples of input, action, expected output.
moving_tests = [
(
[[0,0,0,0],
[4,0,0,0],
[0,0,0,0],
[4,0,2,0]],
Direction.UP,
[[8,0,2,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0... | en | 0.727258 | # Tuples of input, action, expected output. | 2.561683 | 3 |
test/utils/test_value.py | HansBug/pji | 0 | 7057 | import pytest
from pji.utils import ValueProxy
@pytest.mark.unittest
class TestUtilsValue:
def test_value_proxy_init(self):
value = ValueProxy()
assert value.value is None
value = ValueProxy(233)
assert value.value == 233
def test_value_proxy_set(self):
value = Value... | import pytest
from pji.utils import ValueProxy
@pytest.mark.unittest
class TestUtilsValue:
def test_value_proxy_init(self):
value = ValueProxy()
assert value.value is None
value = ValueProxy(233)
assert value.value == 233
def test_value_proxy_set(self):
value = Value... | none | 1 | 2.43444 | 2 | |
intro.py | Ebenazer-2002/library-management | 0 | 7058 | #Intro Page
from tkinter import *
from PIL import Image, ImageTk
import cv2
#----------------------------Start Function--------------------------#
def start(event):
label1.destroy()
import log
win.destroy()
log.main()
#------------------------Main Window---------------------------------#li
def main_... | #Intro Page
from tkinter import *
from PIL import Image, ImageTk
import cv2
#----------------------------Start Function--------------------------#
def start(event):
label1.destroy()
import log
win.destroy()
log.main()
#------------------------Main Window---------------------------------#li
def main_... | en | 0.093553 | #Intro Page #----------------------------Start Function--------------------------# #------------------------Main Window---------------------------------#li # start function on pressing any key # opens video #----------------------------------------------------------------- # defining show function # frame count #------... | 3.142491 | 3 |
notebooks/week4_help.py | hugh9876/04-multivariate-analysis | 0 | 7059 | """
This module provides helper functions to support exercises during AM1
with outliers, robust regression and template regression in the CORE
data analytics workshop series, week 4.
"""
import numpy as np
import pandas as pd
import math
from collections import namedtuple
def recovery_sulphur_dataframe_wit... | """
This module provides helper functions to support exercises during AM1
with outliers, robust regression and template regression in the CORE
data analytics workshop series, week 4.
"""
import numpy as np
import pandas as pd
import math
from collections import namedtuple
def recovery_sulphur_dataframe_wit... | en | 0.84127 | This module provides helper functions to support exercises during AM1
with outliers, robust regression and template regression in the CORE
data analytics workshop series, week 4. Return dataframe representing recovery as a function of sulphur.
Parameters:
----------
outlier_probability:
This... | 3.008395 | 3 |
tests/actions/test_mutable_token_action.py | 0xOmarA/RadixLib | 32 | 7060 | <filename>tests/actions/test_mutable_token_action.py
from radixlib.actions import CreateTokenDefinition
from typing import Dict, Any
import unittest
class TestMutableTokenAction(unittest.TestCase):
""" Unit tests for the CreateTokenDefinition action of mutable tokens """
ActionDict: Dict[str, Any] = {
... | <filename>tests/actions/test_mutable_token_action.py
from radixlib.actions import CreateTokenDefinition
from typing import Dict, Any
import unittest
class TestMutableTokenAction(unittest.TestCase):
""" Unit tests for the CreateTokenDefinition action of mutable tokens """
ActionDict: Dict[str, Any] = {
... | en | 0.761198 | Unit tests for the CreateTokenDefinition action of mutable tokens Tests the derivation of the mainnet wallet addresses from the public key # The action loaded from the dictionary # Asserting that the CreateTokenDefinition object understood the content of the dictionary Tests the conversion of the token account to a dic... | 2.712122 | 3 |
src/tests/testModules/loadCfg_typeCasting/allowsCastFailKeeping/primativeTypes.py | Trimatix/carica | 5 | 7061 | floatVar = 1.0
listVar = [3, "hello"]
dictVar = {
"myField": "value"
}
aotVar = [dictVar, dictVar]
intVar = 1 | floatVar = 1.0
listVar = [3, "hello"]
dictVar = {
"myField": "value"
}
aotVar = [dictVar, dictVar]
intVar = 1 | none | 1 | 2.199266 | 2 | |
quacc/recipes/xtb/__init__.py | arosen93/HT-ASE | 9 | 7062 | <filename>quacc/recipes/xtb/__init__.py
"""Recipes for xTB"""
| <filename>quacc/recipes/xtb/__init__.py
"""Recipes for xTB"""
| en | 0.851488 | Recipes for xTB | 0.917481 | 1 |
src/python/pants/backend/native/subsystems/xcode_cli_tools.py | StephanErb/pants | 0 | 7063 | <filename>src/python/pants/backend/native/subsystems/xcode_cli_tools.py
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from p... | <filename>src/python/pants/backend/native/subsystems/xcode_cli_tools.py
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from p... | en | 0.873959 | # coding=utf-8 # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). Subsystem to detect and provide the XCode command line developer tools. This subsystem exists to give a useful error message if the tools aren't installed, and because t... | 1.763299 | 2 |
improver_tests/regrid/test_RegridWithLandSeaMask.py | yzhaobom/improver | 77 | 7064 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | en | 0.671855 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a... | 1.419525 | 1 |
setup.py | garnaat/details | 27 | 7065 | <reponame>garnaat/details<filename>setup.py
#!/usr/bin/env python
from setuptools import setup, find_packages
import os
requires = [
]
setup(
name='details',
version=open(os.path.join('details', '_version')).read(),
description='Tools for processing AWS detailed billing reports',
long_description=o... | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
requires = [
]
setup(
name='details',
version=open(os.path.join('details', '_version')).read(),
description='Tools for processing AWS detailed billing reports',
long_description=open('README.md').read(),
author='<NAME>'... | ru | 0.26433 | #!/usr/bin/env python | 1.18698 | 1 |
beam_telescope_analysis/testing/test_kalman.py | YannickDieter/beam_telescope_analysis | 3 | 7066 | <filename>beam_telescope_analysis/testing/test_kalman.py
''' Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis.
'''
import os
import unittest
import numpy as np
from beam_telescope_analysis import track_analysis
from beam_telescope_a... | <filename>beam_telescope_analysis/testing/test_kalman.py
''' Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis.
'''
import os
import unittest
import numpy as np
from beam_telescope_analysis import track_analysis
from beam_telescope_a... | en | 0.701212 | Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis. # virtual X server for plots under headless LINUX travis testing is needed # virtual X server for plots under headless LINUX travis testing is needed # Remove created files # os.remove(... | 2.523461 | 3 |
test/test_workflow.py | asnramos/asv | 0 | 7067 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import json
from os.path import join, isfile
import pytest
from asv import util
from . import tools
def test_run_publish(capfd, basic_conf_2):
tmpdir, local, conf, machine_file = basic_conf_2
tmpdir = util.lon... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import json
from os.path import join, isfile
import pytest
from asv import util
from . import tools
def test_run_publish(capfd, basic_conf_2):
tmpdir, local, conf, machine_file = basic_conf_2
tmpdir = util.lon... | en | 0.708051 | # Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests a typical complete run/publish workflow # Check parameterized test json data format # revision # Check that the skip options work # Check EXISTING and --environment work # Remove the benchmarks.json file and check publish fails | 1.921284 | 2 |
trainer.py | Metro1998/P-DQN | 5 | 7068 | # @author Metro
# @time 2021/11/24
import os.path
import gym
from agents.pdqn import P_DQN
from utilities.memory import ReplayBuffer
from utilities.utilities import *
from utilities.route_generator import generate_routefile
class Train_and_Evaluate(object):
def __init__(self, config):
# Environment
... | # @author Metro
# @time 2021/11/24
import os.path
import gym
from agents.pdqn import P_DQN
from utilities.memory import ReplayBuffer
from utilities.utilities import *
from utilities.route_generator import generate_routefile
class Train_and_Evaluate(object):
def __init__(self, config):
# Environment
... | en | 0.614161 | # @author Metro # @time 2021/11/24 # Environment # Agent # Memory # Training Loop :return: # n_steps | 2.182561 | 2 |
server/splunkdj/views.py | splunk/splunk-webframework | 31 | 7069 | import sys
import pprint
import json
import datetime
import uuid
import urllib
import types
import traceback
from django.core.urlresolvers import reverse, resolve
from django.http import HttpResponseRedirect, Http404, HttpResponseServerError, HttpResponseNotFound
from django.conf import settings
from django.contrib.aut... | import sys
import pprint
import json
import datetime
import uuid
import urllib
import types
import traceback
from django.core.urlresolvers import reverse, resolve
from django.http import HttpResponseRedirect, Http404, HttpResponseServerError, HttpResponseNotFound
from django.conf import settings
from django.contrib.aut... | en | 0.869712 | Format values appropriately for json.dumps: - Basic types will remain the same - Unicode will be converted to str - Everything else will be formatted using pprint # We use Django's debug reporter, even though we are doing our own template. # This is because it has a great way of collecting all t... | 1.965002 | 2 |
wbia/plottool/interact_keypoints.py | mmulich/wildbook-ia | 0 | 7070 | <filename>wbia/plottool/interact_keypoints.py
# -*- coding: utf-8 -*-
import logging
import utool as ut
import six
from . import draw_func2 as df2
from wbia.plottool import plot_helpers as ph
from wbia.plottool import interact_helpers as ih
from wbia.plottool.viz_featrow import draw_feat_row
from wbia.plottool.viz_keyp... | <filename>wbia/plottool/interact_keypoints.py
# -*- coding: utf-8 -*-
import logging
import utool as ut
import six
from . import draw_func2 as df2
from wbia.plottool import plot_helpers as ph
from wbia.plottool import interact_helpers as ih
from wbia.plottool.viz_featrow import draw_feat_row
from wbia.plottool.viz_keyp... | en | 0.346902 | # -*- coding: utf-8 -*- CommandLine: python -m wbia.plottool.interact_keypoints --exec-KeypointInteraction --show python -m wbia.plottool.interact_keypoints --exec-KeypointInteraction --show --fname=lena.png Example: >>> # DISABLE_DOCTEST >>> from wbia.plottool.interact_keypoints im... | 2.233935 | 2 |
tb/storage/__init__.py | DronMDF/manabot | 1 | 7071 | from .database import StDatabase
from .telegram import StTelegram
from .tinydb import TinyDataBase, TinySelect
from .utility import StDispatch
| from .database import StDatabase
from .telegram import StTelegram
from .tinydb import TinyDataBase, TinySelect
from .utility import StDispatch
| none | 1 | 1.089895 | 1 | |
algorithms/maths/chinese_remainder_theorem.py | hbqdev/algorithms | 22,426 | 7072 | <reponame>hbqdev/algorithms<filename>algorithms/maths/chinese_remainder_theorem.py
from algorithms.maths.gcd import gcd
from typing import List
def solve_chinese_remainder(num : List[int], rem : List[int]):
"""
Computes the smallest x that satisfies the chinese remainder theorem
for a system of equations.
... | from algorithms.maths.gcd import gcd
from typing import List
def solve_chinese_remainder(num : List[int], rem : List[int]):
"""
Computes the smallest x that satisfies the chinese remainder theorem
for a system of equations.
The system of equations has the form:
x % num[0] = rem[0]
x % num[1] = ... | en | 0.821942 | Computes the smallest x that satisfies the chinese remainder theorem for a system of equations. The system of equations has the form: x % num[0] = rem[0] x % num[1] = rem[1] ... x % num[k - 1] = rem[k - 1] Where k is the number of elements in num and rem, k > 0. All numbers in num needs ... | 3.956976 | 4 |
exercises/ja/exc_03_16_01.py | Jette16/spacy-course | 2,085 | 7073 | <reponame>Jette16/spacy-course<gh_stars>1000+
import spacy
nlp = spacy.load("ja_core_news_sm")
text = (
"チックフィレイはジョージア州カレッジパークに本社を置く、"
"チキンサンドを専門とするアメリカのファストフードレストランチェーンです。"
)
# トークナイズのみ行う
doc = nlp(text)
print([token.text for token in doc])
| import spacy
nlp = spacy.load("ja_core_news_sm")
text = (
"チックフィレイはジョージア州カレッジパークに本社を置く、"
"チキンサンドを専門とするアメリカのファストフードレストランチェーンです。"
)
# トークナイズのみ行う
doc = nlp(text)
print([token.text for token in doc]) | ja | 0.99995 | # トークナイズのみ行う | 2.977588 | 3 |
apphelper/image.py | caiyueliang/chineseocr | 0 | 7074 | <filename>apphelper/image.py
# -*- coding: utf-8 -*-
"""
##图像相关函数
@author: lywen
"""
import sys
import six
import os
import base64
import requests
import numpy as np
import cv2
from PIL import Image
import traceback
import uuid
from glob import glob
from bs4 import BeautifulSoup
def sort_box_(box):
x1,y1,x2,y2,x3... | <filename>apphelper/image.py
# -*- coding: utf-8 -*-
"""
##图像相关函数
@author: lywen
"""
import sys
import six
import os
import base64
import requests
import numpy as np
import cv2
from PIL import Image
import traceback
import uuid
from glob import glob
from bs4 import BeautifulSoup
def sort_box_(box):
x1,y1,x2,y2,x3... | en | 0.174368 | # -*- coding: utf-8 -*- ##图像相关函数 @author: lywen newBox = [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] ## sort x newBox = sorted(newBox,key=lambda x:x[0]) x1,y1 = sorted(newBox[:2],key=lambda x:x[1])[0] index = newBox.index([x1,y1]) newBox.pop(index) newBox = sorted(newBox,key=lambda x:-x[1]) x4,y4 = so... | 2.634312 | 3 |
opendatatools/common/ui_util.py | harveywwu/OpenData | 0 | 7075 | # -*- coding: UTF-8 -*-
import sys, time
class ShowProcess():
"""
显示处理进度的类
调用该类相关函数即可实现处理进度的显示
"""
i = 0 # 当前的处理进度
max_steps = 0 # 总共需要处理的次数
max_arrow = 50 #进度条的长度
infoDone = 'done'
# 初始化函数,需要知道总共的处理次数
def __init__(self, max_steps, infoDone = 'Done'):
self.max_steps = ... | # -*- coding: UTF-8 -*-
import sys, time
class ShowProcess():
"""
显示处理进度的类
调用该类相关函数即可实现处理进度的显示
"""
i = 0 # 当前的处理进度
max_steps = 0 # 总共需要处理的次数
max_arrow = 50 #进度条的长度
infoDone = 'done'
# 初始化函数,需要知道总共的处理次数
def __init__(self, max_steps, infoDone = 'Done'):
self.max_steps = ... | zh | 0.898902 | # -*- coding: UTF-8 -*- 显示处理进度的类 调用该类相关函数即可实现处理进度的显示 # 当前的处理进度 # 总共需要处理的次数 #进度条的长度 # 初始化函数,需要知道总共的处理次数 # 显示函数,根据当前的处理进度i显示进度 # 效果为[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]100.00% #计算显示多少个'>' #计算显示多少个'-' #计算完成进度,格式为xx.xx% #带输出的字符串,'\r'表示不换行回到最左边 #打印字符到终端 | 3.48769 | 3 |
data_structure/stack_and_queue/494. Target Sum_ Medium.py | JunzhongLin/leetcode_practice | 0 | 7076 | <filename>data_structure/stack_and_queue/494. Target Sum_ Medium.py
'''
You are given an integer array nums and an integer target.
You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.
For example, if nums = [2, 1], you ... | <filename>data_structure/stack_and_queue/494. Target Sum_ Medium.py
'''
You are given an integer array nums and an integer target.
You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.
For example, if nums = [2, 1], you ... | en | 0.75645 | You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers. For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build ... | 3.704901 | 4 |
fixtrack/frontend/pickable_markers.py | os-gabe/fixtrack | 0 | 7077 | import numpy as np
from fixtrack.frontend.pickable_base import PickableBase
from vispy import scene
class PickableMarkers(PickableBase):
"""
Markers that can highlight on hover and be selected
"""
class State(PickableBase.State):
def __init__(self, **kwargs):
super(PickableMarker... | import numpy as np
from fixtrack.frontend.pickable_base import PickableBase
from vispy import scene
class PickableMarkers(PickableBase):
"""
Markers that can highlight on hover and be selected
"""
class State(PickableBase.State):
def __init__(self, **kwargs):
super(PickableMarker... | en | 0.864996 | Markers that can highlight on hover and be selected | 2.394797 | 2 |
examples/blocking_subscribe.py | FFY00/jeepney | 0 | 7078 | <reponame>FFY00/jeepney
"""
Example of subscribing to a D-Bus signal using blocking I/O.
This subscribes to the signal for a desktop notification being closed.
To try it, start this script, then trigger a desktop notification, and close it
somehow to trigger the signal. Use Ctrl-C to stop the script.
This example rel... | """
Example of subscribing to a D-Bus signal using blocking I/O.
This subscribes to the signal for a desktop notification being closed.
To try it, start this script, then trigger a desktop notification, and close it
somehow to trigger the signal. Use Ctrl-C to stop the script.
This example relies on the ``org.freedes... | en | 0.769838 | Example of subscribing to a D-Bus signal using blocking I/O. This subscribes to the signal for a desktop notification being closed. To try it, start this script, then trigger a desktop notification, and close it somehow to trigger the signal. Use Ctrl-C to stop the script. This example relies on the ``org.freedesktop... | 2.800322 | 3 |
test.py | league3236/shholiday | 0 | 7079 | <reponame>league3236/shholiday<gh_stars>0
from shholiday import holiday2020 as hd
daytuple = (1,1)
nowholiday = hd.holiday2020()
print(nowholiday.is_holiday(daytuple)) | from shholiday import holiday2020 as hd
daytuple = (1,1)
nowholiday = hd.holiday2020()
print(nowholiday.is_holiday(daytuple)) | none | 1 | 2.440787 | 2 | |
blog/migrations/0005_title_null.py | encukou/Zpetnovazebnik | 1 | 7080 | # Generated by Django 2.1.7 on 2019-02-27 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_longer_password'),
]
operations = [
migrations.AlterField(
model_name='session',
name='title',
... | # Generated by Django 2.1.7 on 2019-02-27 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_longer_password'),
]
operations = [
migrations.AlterField(
model_name='session',
name='title',
... | en | 0.741794 | # Generated by Django 2.1.7 on 2019-02-27 14:23 | 1.561303 | 2 |
setup.py | Kuba77/Xian-DB | 1 | 7081 | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='xiandb',
version='0.2.0',
description='A database model for Xian',
long_d... | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='xiandb',
version='0.2.0',
description='A database model for Xian',
long_d... | none | 1 | 1.355741 | 1 | |
yolo3/focal_loss.py | ashishpatel26/tf2-yolo3 | 43 | 7082 | from functools import partial
import tensorflow as tf
_EPSILON = tf.keras.backend.epsilon()
def register_keras_custom_object(cls):
tf.keras.utils.get_custom_objects()[cls.__name__] = cls
return cls
def binary_focal_loss(y_true, y_pred, gamma, *, pos_weight=None, from_logits=False, label_smoothing=None):
... | from functools import partial
import tensorflow as tf
_EPSILON = tf.keras.backend.epsilon()
def register_keras_custom_object(cls):
tf.keras.utils.get_custom_objects()[cls.__name__] = cls
return cls
def binary_focal_loss(y_true, y_pred, gamma, *, pos_weight=None, from_logits=False, label_smoothing=None):
... | en | 0.84323 | # Helper functions below # Compute probabilities for the positive class # Terms for the positive and negative class components of the loss # Term involving the log and ReLU # Combine all the terms into the loss # For numerical stability (so we don't inadvertently take the log of 0) # Loss for the positive examples # Lo... | 2.218011 | 2 |
characters/models/characters.py | Sult/evetool | 0 | 7083 | import time
from collections import OrderedDict
from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from django.utils.timezone import utc
from .skills import Skill, SkillGroup
from metrics.models import Corporation
from tasks.models import EveApiCache, Task
from evet... | import time
from collections import OrderedDict
from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from django.utils.timezone import utc
from .skills import Skill, SkillGroup
from metrics.models import Corporation
from tasks.models import EveApiCache, Task
from evet... | en | 0.694942 | charactertype apis #get right icon for characters view #def character sheet image #get the data for landing page after character selection #employment history of a player #result = utils.connection.get_cache(cache_key) #get skill in training #characters trained skills #get skillqueue #get total skillpoints for skills i... | 2.029127 | 2 |
webex_assistant_sdk/templates/mindmeld_template/{{cookiecutter.skill_name}}/{{cookiecutter.skill_name}}/__init__.py | sachanacar/webex-assistant-sdk | 0 | 7084 | # -*- coding: utf-8 -*-
from {{cookiecutter.skill_name}}.root import app
__all__ = ['app']
| # -*- coding: utf-8 -*-
from {{cookiecutter.skill_name}}.root import app
__all__ = ['app']
| en | 0.769321 | # -*- coding: utf-8 -*- | 1.007111 | 1 |
backend/api/v1/dialogs/urls.py | donicrazy/ChatApp | 0 | 7085 | from django.urls import path
from backend.api.v1.dialogs.views import (
DialogListCreateView,
DialogRetrieveUpdateDestroyAPIView,
DialogMembershipListCreateView,
DialogMessageListCreateView,
DialogMessageRetrieveUpdateDestroyAPIView,
)
urlpatterns = [
path('', DialogListCreateView.as_view()),
... | from django.urls import path
from backend.api.v1.dialogs.views import (
DialogListCreateView,
DialogRetrieveUpdateDestroyAPIView,
DialogMembershipListCreateView,
DialogMessageListCreateView,
DialogMessageRetrieveUpdateDestroyAPIView,
)
urlpatterns = [
path('', DialogListCreateView.as_view()),
... | none | 1 | 1.803957 | 2 | |
biomaj2galaxy/commands/init.py | genouest/biomaj2galaxy | 1 | 7086 | <filename>biomaj2galaxy/commands/init.py
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from bioblend import galaxy
from biomaj2galaxy import config, pass_context
from biomaj2galaxy.io import info, warn
import click
CONFIG_TEM... | <filename>biomaj2galaxy/commands/init.py
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from bioblend import galaxy
from biomaj2galaxy import config, pass_context
from biomaj2galaxy.io import info, warn
import click
CONFIG_TEM... | en | 0.656237 | # coding: utf-8 ## BioMAJ2Galaxy: Global Configuration File. # Each stanza should contain a single Galaxy server to interact with. # # You can set the key __default to the name of a default instance __default: local local: url: "%(url)s" apikey: "%(apikey)s" Help initialize global configuration (in home direct... | 2.434054 | 2 |
datamart/tests/test_Dimension.py | josemrsantos/zoopla_datamart | 1 | 7087 | <filename>datamart/tests/test_Dimension.py
from ..datamart import *
def test_create_dimension():
dimension = Dimension("test_dimension")
assert dimension.is_degenerate == False
def test_create_dimension_insert_2_identical_lines():
''' with 2 identical lines, only one gets stored
'''
dimension = Di... | <filename>datamart/tests/test_Dimension.py
from ..datamart import *
def test_create_dimension():
dimension = Dimension("test_dimension")
assert dimension.is_degenerate == False
def test_create_dimension_insert_2_identical_lines():
''' with 2 identical lines, only one gets stored
'''
dimension = Di... | en | 0.922827 | with 2 identical lines, only one gets stored with 2 identical lines and one different, only 2 get stored | 2.476546 | 2 |
preprocessing/convert_formats/msmarco_doc_create_train_input.py | PranjaliJain/matchmaker | 97 | 7088 | #
# msmarco doc: create the train.tsv triples
# -------------------------------
import random
random.seed(42)
import argparse
import os
import sys
from tqdm import tqdm
sys.path.append(os.getcwd())
from matchmaker.evaluation.msmarco_eval import *
from collections import defaultdict
from matchmaker.dataloaders.blin... | #
# msmarco doc: create the train.tsv triples
# -------------------------------
import random
random.seed(42)
import argparse
import os
import sys
from tqdm import tqdm
sys.path.append(os.getcwd())
from matchmaker.evaluation.msmarco_eval import *
from collections import defaultdict
from matchmaker.dataloaders.blin... | en | 0.539342 | # # msmarco doc: create the train.tsv triples # ------------------------------- # # config # # # load data # ------------------------------- # #collection_length = {} # id<\t>text .... #collection_length[_id] = len(tokenizer.tokenize(max_char_doc)) # id<\t>text .... # # produce output # ------------------------------- ... | 1.771194 | 2 |
tests/communities/test_reply.py | powerblossom/workcloud | 1 | 7089 | <reponame>powerblossom/workcloud
from core.response import Response
from communities.tests import TestCase
class ReplyPermissionTest(TestCase):
def setUp(self):
self.create_user(is_staff=True)
def test_permission_reply_all(self):
self.create_forum()
self.create_thread()
thread... | from core.response import Response
from communities.tests import TestCase
class ReplyPermissionTest(TestCase):
def setUp(self):
self.create_user(is_staff=True)
def test_permission_reply_all(self):
self.create_forum()
self.create_thread()
thread_id = self.thread.id
res... | none | 1 | 2.438903 | 2 | |
examples/Word2Vec_AverageVectorsTuto.py | noiseux1523/Deep-Belief-Network | 1 | 7090 | <reponame>noiseux1523/Deep-Belief-Network
# Author: <NAME>
# Date: 8/6/2014
#
# This file contains code to accompany the Kaggle tutorial
# "Deep learning goes to the movies". The code in this file
# is for Parts 2 and 3 of the tutorial, which cover how to
# train a model using Word2Vec.
#
# *********************... | # Author: <NAME>
# Date: 8/6/2014
#
# This file contains code to accompany the Kaggle tutorial
# "Deep learning goes to the movies". The code in this file
# is for Parts 2 and 3 of the tutorial, which cover how to
# train a model using Word2Vec.
#
# *************************************** #
# ****** Read the t... | en | 0.843297 | # Author: <NAME> # Date: 8/6/2014 # # This file contains code to accompany the Kaggle tutorial # "Deep learning goes to the movies". The code in this file # is for Parts 2 and 3 of the tutorial, which cover how to # train a model using Word2Vec. # # *************************************** # # ****** Read the two... | 3.899462 | 4 |
src/phl_budget_data/etl/qcmr/positions/__init__.py | PhiladelphiaController/phl-budget-data | 0 | 7091 | from .core import FullTimePositions
| from .core import FullTimePositions
| none | 1 | 0.972674 | 1 | |
sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response.py | tzhanl/azure-sdk-for-python | 1 | 7092 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | en | 0.502815 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ... | 1.995331 | 2 |
python/ds/spiralprint.py | unhingedporter/DataStructureMustKnow | 3 | 7093 | # Python3 program to print
# given matrix in spiral form
def spiralPrint(m, n, a):
start_row_index = 0
start_col_index = 0
l = 0
''' start_row_index - starting row index
m - ending row index
start_col_index - starting column index
n - ending column index
i - iterator '''
while (start... | # Python3 program to print
# given matrix in spiral form
def spiralPrint(m, n, a):
start_row_index = 0
start_col_index = 0
l = 0
''' start_row_index - starting row index
m - ending row index
start_col_index - starting column index
n - ending column index
i - iterator '''
while (start... | en | 0.660865 | # Python3 program to print # given matrix in spiral form start_row_index - starting row index m - ending row index start_col_index - starting column index n - ending column index i - iterator # Print the first row from # the remaining rows # Print the last column from # the remaining columns # Print the las... | 4.593018 | 5 |
rest-api/routers/authorization.py | marintrace/backend | 2 | 7094 | <gh_stars>1-10
"""
Authorization Utilities
"""
from shared.models.user_entities import User
from shared.service.jwt_auth_wrapper import JWTAuthManager
manager = JWTAuthManager(oidc_vault_secret="oidc/rest",
object_creator=lambda claims, assumed_role, user_roles: User(
... | """
Authorization Utilities
"""
from shared.models.user_entities import User
from shared.service.jwt_auth_wrapper import JWTAuthManager
manager = JWTAuthManager(oidc_vault_secret="oidc/rest",
object_creator=lambda claims, assumed_role, user_roles: User(
first_name=... | en | 0.773941 | Authorization Utilities | 1.929654 | 2 |
photonpy/tests/psf_g2d_sigma.py | qnano/photonpy | 5 | 7095 | import matplotlib.pyplot as plt
import numpy as np
from photonpy.cpp.context import Context
import photonpy.cpp.gaussian as gaussian
from photonpy.smlm.util import imshow_hstack
from photonpy.cpp.estimator import Estimator
def CheckDeriv(psf:Estimator, theta):
nderiv,ev=psf.NumDeriv(theta,eps=1e-6)
deriv,ev=p... | import matplotlib.pyplot as plt
import numpy as np
from photonpy.cpp.context import Context
import photonpy.cpp.gaussian as gaussian
from photonpy.smlm.util import imshow_hstack
from photonpy.cpp.estimator import Estimator
def CheckDeriv(psf:Estimator, theta):
nderiv,ev=psf.NumDeriv(theta,eps=1e-6)
deriv,ev=p... | it | 0.089633 | # CheckDeriv(psf_sigma) | 2.187886 | 2 |
tests/tools_tests/helpers_tests.py | Gautierhyp/tespy | 0 | 7096 | # -*- coding: utf-8
"""Module for testing helper functions.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/tools_tests/helpers_tests.py
SPDX-License-Identifier: MIT
"""
... | # -*- coding: utf-8
"""Module for testing helper functions.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/tools_tests/helpers_tests.py
SPDX-License-Identifier: MIT
"""
... | en | 0.839099 | # -*- coding: utf-8 Module for testing helper functions. This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted by the contributors recorded in the version control history of the file, available from its original location tests/tools_tests/helpers_tests.py SPDX-License-Identifier: MIT Test newt... | 2.853079 | 3 |
theory/model/form.py | ralfonso/theory | 4 | 7097 | import formencode
import pylons
from pylons import app_globals as g
class OutputSchema(formencode.Schema):
allow_extra_fields = False
enabled = formencode.validators.Int()
class ConfigForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
#pre_validators = [formencode.Nest... | import formencode
import pylons
from pylons import app_globals as g
class OutputSchema(formencode.Schema):
allow_extra_fields = False
enabled = formencode.validators.Int()
class ConfigForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
#pre_validators = [formencode.Nest... | en | 0.671127 | #pre_validators = [formencode.NestedVariables()] # if old name is set, don't do this check Trivial class to be used as State objects to transport information to formencode validators Validate a formencode schema. Works similar to the @validate decorator. On success return a dictionary of parameters from request... | 2.246257 | 2 |
utils/dynamo.py | OnRails-IN/backend | 0 | 7098 | """
Dynamo Utils
============
All utility functions for interactions with DynamoDB
Functions
- ensure_json
- create_user_table
- create_or_update_record
- list_tables
- list_records
- get_record
- delete_table
- delete_record
- check_active
"""
import boto3
from decimal import Deci... | """
Dynamo Utils
============
All utility functions for interactions with DynamoDB
Functions
- ensure_json
- create_user_table
- create_or_update_record
- list_tables
- list_records
- get_record
- delete_table
- delete_record
- check_active
"""
import boto3
from decimal import Deci... | en | 0.642731 | Dynamo Utils ============ All utility functions for interactions with DynamoDB Functions - ensure_json - create_user_table - create_or_update_record - list_tables - list_records - get_record - delete_table - delete_record - check_active Function to ensure that a python object is JS... | 2.681228 | 3 |
cloudcms/branch/__init__.py | gitana/cloudcms-python-driver | 0 | 7099 | from .branch import Branch | from .branch import Branch | none | 1 | 1.034444 | 1 |