text string | size int64 | token_count int64 |
|---|---|---|
# Generated by Django 2.2.15 on 2021-01-29 22:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sitewebapp', '0013_auto_20210130_0409'),
]
operations = [
migrations.RemoveField(
model_name='... | 655 | 228 |
import micropython
# Tests both code paths for built-in exception raising.
# mp_obj_new_exception_msg_varg (exception requires decompression at raise-time to format)
# mp_obj_new_exception_msg (decompression can be deferred)
# NameError uses mp_obj_new_exception_msg_varg for NameError("name '%q' isn't defined")
# `ra... | 1,144 | 380 |
import h5py
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas
import os
from parse import parse
import argparse
parser = argparse.ArgumentParser(description='Plot tracking evaluation results')
parser.add_argument('results_path', help='tracking results file or working directory')
ar... | 2,464 | 793 |
# -*-coding:Utf-8 -*
#--------------------------------------------------------------------------------
# jtlib: test_client.py
#
# jtlib module client test code.
#--------------------------------------------------------------------------------
# BSD 2-Clause License
#
# Copyright (c) 2018, Brian Minard
# All rights r... | 4,166 | 1,328 |
import urllib.request
from urllib.parse import urlencode
from json import loads
from socket import timeout
from ssl import _create_unverified_context
from corsair import *
class Api(object):
def __init__(self, base_url, auth, tls_verify=True):
self.base_url = base_url if base_url[-1] != '/' else base_ur... | 3,785 | 1,136 |
from guide.models import Area
def nav(request):
areas = Area.objects.all()
return {
'areas':areas,
}
| 129 | 45 |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.ascendex import ascendex
class bitmax(ascendex):
def describe(self):
return self.deep_extend(super(b... | 1,009 | 368 |
from queue import Queue
def convert_arr_to_binary_tree(arr):
"""
Takes arr representing level-order traversal of Binary Tree
"""
index = 0
length = len(arr)
if length <= 0 or arr[0] == -1:
return None
root = BinaryTreeNode(arr[index])
index += 1
queue = Queue()
qu... | 1,625 | 502 |
"""
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, ... | 7,232 | 2,072 |
from .arena_object import Object
from ..attributes import Position
class Line(Object):
"""
Class for Line in the ARENA.
"""
def __init__(self, start=Position(0,0,0), end=Position(10,10,10), **kwargs):
super().__init__(object_type="line", start=start, end=end, **kwargs)
| 296 | 99 |
"""
A website requires the users to input username and password to register. Write a program to check the validity of password input by users.
"""
"""Question 18
Level 3
Question:
A website requires the users to input username and password to register. Write a program to check the validity of password input by users.
... | 1,067 | 297 |
"""
Though karonte relies on angr's sim procedures, sometimes these add in the current state some constraints to make the
used analysis faster. For example, if a malloc has an unconstrained size, angr add the constraint
size == angr-defined.MAX_SIZE. Though this makes the analysis faster, it makes impossible to reason ... | 14,561 | 5,235 |
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Ernesto Rico-Schmidt', 'e.rico.schmidt@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'data.sqlite'
}
}
ALLOW... | 2,510 | 912 |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | 15,773 | 5,086 |
# 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 json
from pathlib import Path
import pytest
import cc_net
import cc_net.minify as minify
from cc_net import jsonql, process_wet_fil... | 4,988 | 1,830 |
class ACCOUNTS():
def __init__(self):
self.CodeChef = {
"username": "username",
"password": "password"
}
self.Hackerrank = {
"username": "username",
"password": "password",
"tracks": ["python"]
# Available (... | 647 | 190 |
"""
Defines a generic interface to observation catalog
"""
import numpy as np
from astropy.table import Table, Column
from beast.observationmodel.vega import Vega
__all__ = ["Observations", "gen_SimObs_from_sedgrid"]
class Observations(object):
"""
A generic class that interfaces observation catalog in a s... | 9,353 | 2,766 |
from .cvision import *
from .models import *
from .net import *
from .util import *
| 85 | 27 |
# -*- coding: utf-8 -*-
"""BIC083-Eunyoung-Lee analysis."""
| 60 | 33 |
#
# Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved.
#
# OpenArkCompiler is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WA... | 2,355 | 892 |
from flask import session, request
from flask_restx import Resource, reqparse
from flask_babel import gettext
from modules.LoginModule.LoginModule import user_http_auth
from modules.FlaskModule.FlaskModule import user_api_ns as api
from opentera.redis.RedisRPCClient import RedisRPCClient
from opentera.modules.BaseModul... | 5,749 | 1,501 |
##bu python kodu, selenium ve chromedriver ile çalışmakta, siteyi normal kullanıcı gibi ziyaret edip, gerekli verileri parse ediyor
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
from bs4 import BeautifulSoup
import time, datetime
import json
import requests
import sys
... | 10,790 | 4,404 |
from typing import List, overload
from flow.envs.multiagent.traffic_light_grid import MultiTrafficLightGridPOEnv
from flow.envs.traffic_light_grid import TrafficLightGridPOEnv
from gym.spaces import Box, Discrete
import numpy as np
ID_IDX = 1
class SeqTraffiLightEnv(TrafficLightGridPOEnv):
def __init__(self, en... | 6,542 | 1,892 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''An example of similarity comparison between node-labeled but unweighted
graphs using the marginalized graph kernel.'''
import numpy as np
import networkx as nx
from graphdot import Graph
from graphdot.kernel.marginalized import MarginalizedGraphKernel
from graphdot.micro... | 1,449 | 650 |
import gin
import torch
import logging
from sparse_causal_model_learner_rl.metrics import find_value, find_key
@gin.configurable
def AnnealerThresholdSelector(config, config_object, epoch_info, temp,
adjust_every=100,
multiplier=10, # allow the lo... | 9,735 | 3,142 |
# https://www.youtube.com/watch?v=nGufy7weyGY
'''
Only 1 player so use code module (static class) for player
and a separate shared code module for global variables
'''
# import libraries
import pygame, os
import shared, player
def process_events() -> (object, object, bool):
''' get keyboard input and check ... | 3,164 | 1,200 |
class Solution:
# @param {string} s1
# @param {string} s2
# @param {string} s3
# @return {boolean}
def isInterleave(self, s1, s2, s3):
m = len(s1)
n = len(s2)
if m+n != len(s3):
return False
table = [([False] * (m+1)) for i in range(n+1)]
... | 926 | 361 |
from .token import Token
from .utilities import get_token_expiration
from .services.auth_service import AuthService
class Vault:
def __init__(self, url, customer_alias, database_alias, client_id, client_secret, user_web_token=None, jwt=None):
"""
if user_web_token is passed in, then vv will authen... | 3,119 | 894 |
#!/usr/bin/env python
import os
import pkgutil
import sys
from setuptools import setup, find_packages
from subprocess import check_call, CalledProcessError
if not pkgutil.find_loader('relic'):
relic_local = os.path.exists('relic')
relic_submodule = (relic_local and
os.path.exists('.gitm... | 2,000 | 643 |
import os
# filters
FILTERS = {
'min_bathrooms': 1,
'min_bedrooms': 3
}
## Location preferences
# The Craigslist site you want to search on.
# For instance, https://sfbay.craigslist.org is SF and the Bay Area.
# You only need the beginning of the URL.
CRAIGSLIST_SITE = 'sfbay'
# What Craigslist subdirectorie... | 5,362 | 2,475 |
import os
import scipy.io.wavfile
import matplotlib.pyplot as plt
import numpy as np
import os
import random
'''
Create a random dataset with three different frequencies that are always in fase.
Frequencies will be octave [440, 880, 1320].
'''
fs = 16000
x1 = scipy.io.wavfile.read('corpus/Analysis/a440.wav')[1]
x2 ... | 2,569 | 1,003 |
def hello():
return "hello edabit.com"
| 43 | 16 |
#!/usr/bin/env python
import argparse
import os
import gfa_reduce.io as io
import glob
import time
import numpy as np
import copy
import gfa_reduce.common as common
import astropy.io.fits as fits
import gfa_reduce.dark_current as dark_current
from gfa_reduce.analysis.sky import adu_to_surface_brightness
def print_ims... | 3,162 | 1,228 |
# SPDX-License-Identifier: Apache-2.0
from onnxconverter_common.utils import * # noqa
| 88 | 35 |
import re
import time
import datetime
import html
def in_ignoreUpper(lora,key):
for each in lora:
if(key.lower() == each.lower()):
return((True,each))
else:
pass
return((False,None))
def s2hms(seconds):
arr = seconds.split(".")
s1 = arr[0]... | 5,280 | 2,375 |
from base import job_desc_pb2
from base import task_desc_pb2
from base import reference_desc_pb2
from google.protobuf import text_format
import httplib, urllib, re, sys, random
import binascii
import time
import shlex
def add_worker_task(job_name, task, binary, args, worker_id, num_workers, extra_args):
task.uid = 0... | 4,540 | 1,710 |
# Solving the series of linear equations for true action
# and generating function Fourier components
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from matplotlib.ticker import MaxNLocator
import matplotlib.cm as cm
import time
# in units kpc, km/s and 10^11 M_solar
Grav = 430... | 16,059 | 6,716 |
import sys
import time
import csv
import oscn
counties = ['tulsa', 'cimarron', 'adair', 'delaware']
years = ['2010']
for county in counties:
csv_file = open(f'data/{county}-attorneys.csv', "w")
# if this breaks, you may need to mkdir data
writer = csv.writer(csv_file, delimiter=',')
for year in yea... | 748 | 254 |
# -*- encoding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals
from .authentication_middleware import *
from .cors_middleware import *
| 156 | 49 |
"""
Copyright (c) 2019, TransChain.
This source code is licensed under the Apache 2.0 license found in the
LICENSE file in the root directory of this source tree.
"""
from marshmallow import fields
from base64 import b64encode, b64decode
class BytesField(fields.Field):
# BytesField allows to serialize and deser... | 628 | 198 |
from __future__ import absolute_import
from typing import List, Dict, NoReturn, Any
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from requests_api.constants import (
BACKOFF_FACTOR,
STATUS_FORCELIST,
ALLOWED_METHODS
)
class RetryAdapter(HTTPAdapter):
""" creates retr... | 717 | 230 |
import unittest
import game.engine.dice as dice
class DiceRollTest(unittest.TestCase):
def test_dice_roll(self):
roll = dice.roll()
self.assertGreaterEqual(roll, 1)
self.assertLessEqual(roll, 6)
| 225 | 79 |
""" This module contains a pytorch dataset for learning peptide embeddings.
In particular, each "instance" of the dataset comprises two peptide sequences,
as well as the sNebula similarity between them. The sNebula distance reflects
the BLOSSUM similarity transformed from 0 to 1.
"""
import logging
logger = logging.ge... | 7,209 | 2,089 |
"""Combines all components
The `sidebar` component combines all the inputs while other components potentially
have callbacks.
To add or remove components, adjust the `setup`.
If callbacks are present, also adjust `CALLBACK_INPUTS`, `CALLBACK_OUTPUTS` and
`callback_body`.
"""
from collections import OrderedDict
from ... | 3,961 | 973 |
# TODO: implement a page_parser that uses nlp and stats to get a good read of a file.
class page_parser(object):
"""
a multi purpose parser that can read these file types
"""
def __init__(self):
pass
| 206 | 65 |
"""crwal_and_scrap trying to gathering news with web scrawl"""
from crwal_and_scrap.main import main
main()
| 110 | 40 |
from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "a"
@dataclass
class Nametest:
choice: List[object] = field(
default_factory=list,
metadata={
"type": "Elements",
"choices": (
{
"name": "_ele",
... | 1,525 | 379 |
import pprint
from app.models import Cepage
data = []
counter = 0
with open('static_data.tsv', 'r') as file:
for line in file:
if counter == 0:
headers = line.split('\t')
print(len(headers))
else:
print(len(line.split('\t')))
data.append(dict(zip(head... | 1,505 | 469 |
# Source and destination file names.
test_source = "data/math.txt"
test_destination = "math_output_html.html"
# Keyword parameters passed to publish_file.
reader_name = "standalone"
parser_name = "rst"
writer_name = "html"
# Extra setting
settings_overrides['math_output'] = 'HTML'
settings_overrides['stylesheet_path... | 431 | 150 |
'''
Panel object contains
up to one image in the background,
and any number of catalogs plotted.
'''
import astroquery.skyview
class Panel:
'''
A single frame of a finder chart,
that has up to one image in the background,
and any number of catalogs plotted.
'''
def __init__(self, image, cata... | 1,083 | 391 |
import os,sys
import time
if(len(sys.argv) < 3):
print("Format -> handle.py <input_file> <base_directory>")
exit()
input_file_name = sys.argv[1]
base_direc = sys.argv[2]
# with open(input_file_name, "r") as input_file:
# data = input_file.read()
input_ = open(input_file_name, "r")
newick_format=""
# lines=data.s... | 2,437 | 1,192 |
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.agent import Agent
from rasa_core.interpreter import RegexInterpreter
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
import json
import config
from errbot import BotPlugin, botcm... | 2,849 | 839 |
from __future__ import absolute_import
import math
from .base import (
Tree,
TreeIterator,
)
def _get_left_index(node_index):
return 2 * node_index + 1
def _get_right_index(node_index):
return 2 * node_index + 2
def _get_depth(node_index):
"""
The indices in depth d is
(# of node... | 2,943 | 981 |
import csv
import json
from collections import defaultdict
f = open('DOOSTROOM_new.csv', 'rU')
h = defaultdict(lambda: defaultdict(lambda: defaultdict(int)))
for line in f:
line_list = line.split(";")
h[line_list[7]]["oorsprong"][line_list[3]] += int(line_list[12])
h[line_list[7]]["profiel"][line_list[6]] +=... | 501 | 202 |
import boto3
from botocore.vendored import requests
import json
from uuid import uuid4
def send(event, context, response_status, Reason=None, ResponseData=None, PhysicalResourceId=None):
response_url = event.get('ResponseURL', "")
json_body = json.dumps({
'Status' : response_status,
'Reason' : Reason or 'S... | 2,138 | 693 |
"""Main module."""
import os
import sys
import time
from datetime import datetime
import pandas as pd
import ipapi
import sqlalchemy as sqla
try:
DATA_DATE = os.environ['DATA_DATE']
print('Using data from {}'.format(DATA_DATE))
except:
print('Envvar DATA_DATE not set.')
sys.exit(1)
try:
POSTGR... | 6,459 | 2,263 |
# Generated by Django 3.1.13 on 2021-08-03 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biserici', '0032_auto_20210803_1622'),
]
operations = [
migrations.AddField(
model_name='descriere',
name='solee_de... | 653 | 229 |
# -*- coding: utf_8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import cv2
import pickle
import random
import numpy as np
def train_load1(data_path, img_size, output_path):
label_list = []
img_list = []
label_idx = 0
for r... | 9,436 | 3,470 |
from tastypie.api import Api
from encuestas.api.user import UserResource
from encuestas.api.encuesta import EncuestaResource
from encuestas.api.grupo import GrupoResource
from encuestas.api.pregunta import PreguntaResource
from encuestas.api.opcion import OpcionResource
from encuestas.api.link import LinkResource
from ... | 639 | 212 |
from random import randint
from ex1.evento import Evento
class Gerador():
def __init__(self, msg):
self.msg = msg
def gerar_evento(self, tempo):
"""
Método que gera evento levando em conta tempo de execução.
:return: Instancia de Evento ou Nulo se não for para gerar envento
... | 2,371 | 753 |
import json
from tests.base_test import BaseCase
from app.models.bucketlist import Bucketlist
class TestBucketlistEndpoint(BaseCase):
''' A class to test the bucketlist endpoints '''
def setUp(self):
super(TestBucketlistEndpoint, self).setUp()
self.bucketlist_data = {'name': 'Eat Sushi'}
... | 4,221 | 1,247 |
"""
An interface for handling sets of ReadsAlignments.
"""
from pprint import pprint
from SetAPI.generic.SetInterfaceV1 import SetInterfaceV1
from SetAPI import util
class ReadsAlignmentSetInterfaceV1:
def __init__(self, workspace_client):
self.workspace_client = workspace_client
self.set_interfa... | 6,256 | 1,785 |
import collections
import inspect
import json
import jsonschema
import os
import sys
from pprint import pprint
from slugify import slugify
from ...dicthelpers import data_merge
from ..basestore import LinkedStore, linkages
from ..basestore import HeritableDocumentSchema, JSONSchemaCollection, formatChecker
from ..base... | 3,193 | 867 |
from copy import deepcopy
import pytest
from snuba.clickhouse.columns import (
UUID,
AggregateFunction,
Array,
ColumnType,
Date,
DateTime,
Enum,
FixedString,
Float,
IPv4,
IPv6,
Nested,
ReadOnly,
)
from snuba.clickhouse.columns import SchemaModifiers as Modifier
from ... | 3,514 | 1,219 |
"""Base Abstract Template class"""
from __future__ import annotations
import json
from abc import ABC
from collections import OrderedDict
from typing import Any, Dict, List
import numpy as np
import paddle
from paddle import nn
from paddlenlp.transformers.tokenizer_utils import PretrainedTokenizer
from paddle_prompt... | 5,851 | 1,692 |
#!/usr/bin/env python
"""
Test eulerian functions including the random walk
Author : Jingyu Guo
"""
import unittest
from de_novo_assembly.de_bruijn_graph import DeBruijnGraph
from Bio.SeqRecord import SeqRecord
from de_novo_assembly.eulerian import has_euler_path, has_euler_circuit, \
make_contig_from_path, eule... | 2,538 | 947 |
import unittest
import time
import datetime
import json
import sys
#import base64
#from werkzeug.wrappers import Response
sys.path.append("..")
#from flask import current_app
#from werkzeug.datastructures import Headers
from gameevents_app import create_app
#Extensions
from gameevents_app.extensions import db, LO... | 25,351 | 6,870 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides a Regions class.
"""
from .core import Region
from .registry import RegionsRegistry
__all__ = ['Regions']
__doctest_skip__ = ['Regions.read', 'Regions.write', 'Regions.parse',
'Regions.serialize']
class Regi... | 7,810 | 2,086 |
from collections import defaultdict
import itertools
import numpy as np
import pickle
import time
import warnings
from Analysis import binomial_pgf, BranchModel, StaticModel
from simulators.fires.UrbanForest import UrbanForest
from Policies import NCTfires, UBTfires, DWTfires, RHTfires, USTfires
from Utilities import ... | 9,254 | 3,130 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functional tests for `ugetcli` package - `create` command.
Tests functionality of the cli create command with various options.
"""
import os
import unittest
import json
from click.testing import CliRunner
from mock import MagicMock, patch
from ugetcli import cli
from... | 20,265 | 6,008 |
#! /usr/bin/env python
import re
import pandas as pd
from numpy import interp
import os
from pathlib import Path
home = os.environ['HOME']
home_dir = Path(home)
work_dir = home_dir / 'Programming/Python/python-exercises/hackerrank'
# 12/14/2012 16:00:00 Missing_19
pattern = re.compile(r'(\d{1,2}/\d{1,2}/2012)\s+(16:... | 1,647 | 623 |
# -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class ApplyUploadRequest(Request):
def __init__(self):
super(ApplyUploadRequest, self).__init__(
'vod', 'qcloudcliV1', 'ApplyUpload', 'vod.api.qcloud.com')
def get_SubAppId(self):
return self.get_params().get('SubA... | 3,777 | 1,227 |
'''
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
The number of elements initialized in nums1 and nums2 are m and n respectively.
You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2.
Ex... | 981 | 365 |
import string
def foo(shift):
shiftDict = {}
for l in string.ascii_lowercase:
shiftDict[l] = chr((ord(l) - 97 + shift)%26 + 97)
for l in string.ascii_uppercase:
shiftDict[l] = chr((ord(l) - 65 + shift)%26 + 65)
return shiftDict
print(foo(1))
| 275 | 113 |
import tensorflow as tf
def local_displacement_energy(ddf, energy_type, **kwargs):
def gradient_dx(fv):
return (fv[:, 2:, 1:-1, 1:-1] - fv[:, :-2, 1:-1, 1:-1]) / 2
def gradient_dy(fv):
return (fv[:, 1:-1, 2:, 1:-1] - fv[:, 1:-1, :-2, 1:-1]) / 2
def gradient_dz(fv):
return (fv[:, ... | 1,936 | 780 |
# ---------------------------------------------------------------------
# Generic.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# NOC modul... | 1,271 | 339 |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.uberdog.DistributedAvatarManager
from otp.uberdog.OtpAvatarManager import OtpAvatarManager
from otp.otpbase import OTPGlobals
c... | 2,514 | 849 |
import smart_imports
smart_imports.all()
class RoadAdmin(django_admin.ModelAdmin):
list_display = ('id', 'point_1', 'point_2', 'length')
list_filter = ('point_1', 'point_2')
django_admin.site.register(models.Road, RoadAdmin)
| 240 | 91 |
def test_valid(cldf_dataset, cldf_logger):
assert cldf_dataset.validate(log=cldf_logger)
def test_parameters(cldf_dataset):
assert len(list(cldf_dataset["ParameterTable"])) == 100
def test_languages(cldf_dataset):
assert len(list(cldf_dataset["LanguageTable"])) > 4000
| 287 | 115 |
description = 'setup for the status monitor'
group = 'special'
_expcolumn = Column(
Block('Experiment', [
BlockRow(
# Field(name='Proposal', key='exp/proposal', width=7),
# Field(name='Title', key='exp/title', width=20,
# istext=True, maxlen=20),
Field(name... | 5,040 | 1,781 |
"""Bazel rules and macros for running tsec over a ng_module or ts_library."""
load("@npm//@bazel/typescript/internal:ts_config.bzl", "TsConfigInfo")
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo")
load("@npm//tsec:index.bzl", _tsec_test = "tsec_test")
TsecTsconfigInfo = provider(fields = ["src", ... | 4,400 | 1,490 |
'''
Created on Jun 8, 2017
@author: zwieback
'''
import numpy as np
import os
from simulation_internal import simulation_internal
from simulation_paths import path
def Q2_simulation():
ns = [100,250,500]
nrep = 25
niter = 2000
nchains = 2
seed = 1234
scenarios = ['Q2kappa_base', 'Q2la... | 805 | 284 |
#coding:utf-8
import tensorflow as tf
import backward
import forward
import PreProcess as PP
def restore_model(testArr):
with tf.Graph().as_default() as tg:
x = tf.placeholder(tf.float32, [None, forward.INPUT_NODE])
y = forward.forward(x, None)
preValue = tf.argmax(y, 1)
variable_averages = tf.train.Expone... | 1,088 | 487 |
from utils import constants as const
print(const.PATH)
| 56 | 17 |
from __future__ import print_function
import os
import itertools, pkg_resources, sys
from distutils.version import LooseVersion
if LooseVersion(pkg_resources.get_distribution("chainer").version) >= LooseVersion('7.0.0') and \
sys.version_info.major == 2:
print('''Please install chainer <= 7.0.0:
sudo pip in... | 20,619 | 8,826 |
from __future__ import absolute_import, division, print_function
from wxtbx import phil_controls
import wxtbx
from libtbx.utils import Abort, to_unicode, to_str
from libtbx import Auto
import wx
import sys
class ValidatedTextCtrl(wx.TextCtrl, phil_controls.PhilCtrl):
def __init__(self, *args, **kwds):
saved_val... | 4,073 | 1,366 |
import base64
import datetime
import io
import json
import traceback
import aiohttp
import discord
import pytimeparse
from data.services.guild_service import guild_service
from discord.commands import Option, slash_command, message_command, user_command
from discord.ext import commands
from discord.utils import forma... | 20,235 | 6,292 |
"""This module provides various functions used to read/write and generate the data structures used for Path Learn"""
import networkx as nx
import random as rnd
import numpy as np
import pandas as pd
import os
def find_single_paths(G, node, lim, paths_lim=float('inf')):
"""
:param G: A NetworkX graph.
:pa... | 14,699 | 5,168 |
'''
Unit tests for MergeMove.py for HDPTopicModels
Verification merging works as expected and produces valid models.
Attributes
------------
self.Data : K=4 simple WordsData object from AbstractBaseTestForHDP
self.hmodel : K=4 simple bnpy model from AbstractBaseTestForHDP
Coverage
-----------
* run_many_merge_moves... | 9,781 | 3,252 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: crud/Paging.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 5,309 | 1,786 |
import sys
import time
from datetime import datetime, timedelta
import os
import pathlib
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
creation = "C:\\Date de création"
today = "C:\\Date d'aujourd'hui"
last_modification = "C:\\Date de dernière modification"
class MyHandle... | 2,249 | 671 |
# -*- coding: utf-8 -*-
""" BLEND
This module defines classes and methods for blending images.
:Author: Samuel Farrens <samuel.farrens@cea.fr>
"""
import numpy as np
from lmfit import Model
from lmfit.models import GaussianModel, ConstantModel
from modopt.base.np_adjust import pad2d
from sf_tools.image.stamp impor... | 7,956 | 2,703 |
import logging
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, ConversationHandler
#Obtener la info de la sesion
logging.basicConfig(level = logging.INFO, format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logge... | 1,159 | 441 |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import time
import threading as mt
import radical.utils as ru
from . import utils as rpu
from . import states as rps
from . import constants as rpc
from . import compute_unit_description as rpcud
# bulk call... | 42,133 | 11,555 |
#!python
# -*- coding: UTF-8 -*-
'''
################################################################
# File-based stream synchronization.
# @ Sync-stream
# Produced by
# Yuchen Jin @ cainmagi@gmail.com,
# yjin4@uh.edu.
# Requirements: (Pay attention to version)
# python 3.6+
# fasteners 0.16+
# This m... | 11,130 | 3,060 |
import matplotlib as mpl
from matplotlib import cycler
from .api import (
NCDMarkers,
NMDMarkers,
cell_co_occurrence,
cell_components,
cell_density,
cell_map,
cell_morphology,
community_map,
expression_map,
neighborhood_analysis,
neighbors_map,
spatial_co_expression,
... | 1,636 | 658 |
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
pin_terminal = [15,16] #definisi pin GPIO yg terhubung ke relay terminal
GPIO.setup(pin_terminal, GPIO.OUT)
def terminal_on(pin): #fungsi untuk menyalakan lampu (NC)
GPIO.output(pin, 1)
def terminal_off(pin): #fungsi untuk mematikan lampu (... | 518 | 241 |
'''Escreva um programa que solicite ao usuário dois números e apresente na tela os resultados das
operações aritméticas (soma, subtração, multiplicação, divisão, resto da divisão, exponenciação, radiciação)'''
import math
num1 = float(input('Informe um numero: '))
num2 = float(input('Informe outro numero: '))
print(f... | 722 | 281 |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
import urllib
from remote.url_printer_base import URLPrinterBase
from remote.url_printer_base import registerResultURL
DJANGO_SUB_URL = "benchmark/visualize"
DISPLAY_COLUMNS = [
"identifier",
"metric",
... | 2,706 | 786 |
# Copyright (c) 2017, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | 4,595 | 1,503 |