id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
3262699
<gh_stars>10-100 import unittest import collections from fontParts.base import FontPartsError class TestGuideline(unittest.TestCase): def getGuideline_generic(self): guideline, _ = self.objectGenerator("guideline") guideline.x = 1 guideline.y = 2 guideline.angle = 90 guide...
StarcoderdataPython
278844
<reponame>aheck/reflectrpc<gh_stars>10-100 from __future__ import unicode_literals, print_function from builtins import bytes, dict, list, int, float, str import json import sys from cmd import Cmd from reflectrpc.client import RpcClient from reflectrpc.client import RpcError import reflectrpc import reflectrpc.cmdl...
StarcoderdataPython
151450
#!/usr/bin/env python # # Copyright (C) 2017 ShadowMan # class FatalError(Exception): pass class FrameHeaderParseError(Exception): pass class ConnectClosed(Exception): pass class RequestError(Exception): pass class LoggerWarning(RuntimeWarning): pass class DeamonError(Exception): pass...
StarcoderdataPython
12807077
<gh_stars>1-10 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Test the design_matrix utilities. Note that the tests just looks whether the data produces has correct dimension, not whether it is exact """ import numpy as np from os.path import join...
StarcoderdataPython
179787
__all__ = [ 'AutoInitAndCloseable', 'Disposable', 'NoReentrantContext', 'DisposableContext', ] class AutoInitAndCloseable(object): """ Classes with :meth:`init()` to initialize its internal states, and also :meth:`close()` to destroy these states. The :meth:`init()` method can be repe...
StarcoderdataPython
1662361
<filename>dailyproblems/__main__.py<gh_stars>0 from .problems import Problems, Node obj = Problems() # print(obj.day_one([1, 2, 3, 5, 5], 10)) # print(obj.day_two([1, 2, 3, 4, 5])) e1 = Node('Monday') e2 = Node('Tuesday') e3 = Node('Wednesday') e4 = Node('Thursday') e5 = Node('Friday') e1.nextval = e2 e2.nextval = ...
StarcoderdataPython
4957743
# -*- coding: UTF-8 -*- # # Copyright 2016 Metamarkets Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
StarcoderdataPython
1685065
sequences = input().split("|") numbers = [[int(el) for el in seq.split()] for seq in sequences ] numbers.reverse() numbers = [str(number) for seq in numbers for number in seq] print(" ".join(numbers))
StarcoderdataPython
216857
from .active_lives import ActiveLivesValEMD from .disabled_lives import DisabledLivesProjEMD, DisabledLivesValEMD
StarcoderdataPython
6672169
<gh_stars>0 #!/usr/bin/env python3 """ Module that constructs the CLI, handles configuration files initialization, and sets up logging. """ import logging import sys import click from hopla.cli.add.todo import todo from hopla.cli.authenticate import authenticate from hopla.cli.buy.enchanted_armoire import enchanted_a...
StarcoderdataPython
11341074
<gh_stars>1-10 import numpy as np from sklearn.metrics import mean_squared_error class MSE(): """Class for partitioning based on MSE between the mean and measured values of the sample group. """ def __init__(self): pass def __call__(self, X, X_l, X_r, y, y_l, y_r): ret...
StarcoderdataPython
1767608
<gh_stars>0 from .users import SignIn,SignUp, UsersApi from .trips import ( TripApi, TripsApi, JoinTripApi, UpdateCoordinatesAPI, GetCoordinatesAPI, ) def initialize_routes(api): # Users API api.add_resource(UsersApi, "/api/users") api.add_resource(SignIn, "/api/users/sign-in/<userna...
StarcoderdataPython
9704796
class ViliParser: spacing = 4
StarcoderdataPython
144359
<filename>tests/framework/unit_tests/TSA/testFourier.py # Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
StarcoderdataPython
8159021
<filename>test/scrapy.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding:utf-8 -*- import Queue initial_page = "http://www.zhugelicai.com" url_queue = Queue.Queue() seen = set() seen.insert(initial_page) url_queue.put(initial_page) while(True): # 一直进行直到海枯石烂 if url_queue.size() > 0: current_url = url_qu...
StarcoderdataPython
11295512
<reponame>kharrigian/pitchers-and-pianists<filename>scripts/tap_processing_stage_1.py ## In Stage 1 of proessing, we manually check time series and throw out bad data (sensor malfunction, forgetting the task) ############################### ### Imports ############################### # Standard I/O and Data Handling...
StarcoderdataPython
5084175
<filename>src/sage/combinat/subsets_pairwise.py r""" Subsets whose elements satisfy a predicate pairwise """ #***************************************************************************** # Copyright (C) 2011 <NAME> <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Public License (GPL) # ...
StarcoderdataPython
4977514
#The MIT License # #Copyright (c) 2017 DYNI machine learning & bioacoustics team - Univ. Toulon # #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 limitatio...
StarcoderdataPython
6439632
from __future__ import unicode_literals import django from django.test import TestCase from job.configuration.interface.scale_file import ScaleFileDescription class TestScaleFileDescriptionMediaTypeAllowed(TestCase): def setUp(self): django.setup() def test_accept_all(self): """Tests calli...
StarcoderdataPython
111575
<gh_stars>0 # Generated by Django 3.0.7 on 2020-07-18 10:11 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('to_do', '0009_auto_20200718_1523'), ] operations = [ migrations.CreateMode...
StarcoderdataPython
1734242
<gh_stars>1-10 import subprocess import os import argparse import time DATA_LOC='/home/boubin/Images/' CUBE_LOC='/home/boubin/SoftwarePilot/DistributedRL/Data/' def consoleLog(string): print("#################################################") print("##############DRL Controller:") print(string) print("##########...
StarcoderdataPython
6688672
<reponame>ammsa23/dials<filename>tests/command_line/test_slice_sequence.py from __future__ import annotations import os import procrunner import pytest from dxtbx.serialize import load from dials.array_family import flex def test_slice_sequence_and_compare_with_expected_results(dials_regression, tmpdir): # us...
StarcoderdataPython
3393957
from webApp.utils.cryptographie import * class Credentials: vault_masterpassword = None vault_username = None user_id = None len_vault_username = None len_vault_masterpassword = None # len_user_id_hashed = None user_id_hash = None #user_id={lenght=fixed(64)} def __init__(self, ...
StarcoderdataPython
131689
<filename>day02/python/part1.py #!/usr/bin/env python3 import helper class ShouldNeverGetHere(Exception): pass def main(): # lines = helper.read_lines("example.txt") lines = helper.read_lines("input.txt") horizontal, depth = (0, 0) for line in lines: parts = line.split() instruc...
StarcoderdataPython
9628240
<reponame>lukeenterprise/json-subschema ''' Created on May 30, 2019 @author: <NAME> ''' import unittest from jsonsubschema.checker import isSubschema class TestArraySubtype(unittest.TestCase): def test_identity(self): s1 = {"$schema": "http://json-schema.org/draft-04/schema", "type": "arr...
StarcoderdataPython
8057953
# coding: utf-8 from __future__ import print_function import json from comodit_client.api.platform import Image from comodit_client.api.settings import SimpleSetting from comodit_client.control import completions from comodit_client.control.doc import ActionDoc from comodit_client.control.entity import EntityControl...
StarcoderdataPython
5020018
<filename>rsbook_code/utilities/differences.py from __future__ import print_function,division from builtins import range import numpy as np def gradient_forward_difference(f,x,h): """Approximation of the gradient of f(x) using forward differences with step size h""" g = np.zeros(len(x)) f0 = f(x) for i...
StarcoderdataPython
12803872
def client(api_key, api_url=None, version=None, **kwargs): from client import QencodeApiClient return QencodeApiClient(api_key, api_url=api_url, version=version, **kwargs) def custom_params(): from custom_params import CustomTranscodingParams return CustomTranscodingParams() def format(): from custom_p...
StarcoderdataPython
8089913
<filename>aliyun-api-gateway-demo-sign/ClientDemo.py # -*- coding: utf-8 -*- from com.aliyun.api.gateway.sdk import client from com.aliyun.api.gateway.sdk.http import request from com.aliyun.api.gateway.sdk.common import constant # 这里为友盟一键登录接口 host = "https://verify5.market.alicloudapi.com" url = "/api/v1/mobile/info?...
StarcoderdataPython
79573
# # Copyright (c) 2018 Via Technology Ltd. All Rights Reserved. # Consult your license regarding permissions and restrictions. # """ operations related to airspaces and intersections. """ from psycopg2 import Error, InternalError from psycopg2.extensions import AsIs from psycopg2.extras import DictCursor from itertoo...
StarcoderdataPython
11205547
<filename>setup.py from importlib import import_module from pathlib import Path from setuptools import setup, find_packages SRC_ROOT = 'src' BIN_ROOT = 'bin/' about = import_module(SRC_ROOT + '.rhasspy_desktop_satellite.about') with Path('README.md').open('r') as fh: long_description = fh.read() with Path('requ...
StarcoderdataPython
267033
<reponame>hafeez3000/wnframework<gh_stars>1-10 # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes def get_workflow_name(doctype): if getattr(webnotes.local, "workflow_names", None) is None: webnotes.local.wo...
StarcoderdataPython
5155131
<reponame>ishine/neural_sp #! /usr/bin/env python3 # -*- coding: utf-8 -*- """Test for RNN encoder.""" import importlib import math import numpy as np import pytest import torch from neural_sp.models.torch_utils import ( np2tensor, pad_list ) def make_args(**kwargs): args = dict( input_dim=80, ...
StarcoderdataPython
5154182
import os from dataclasses import dataclass import numpy as np import pandas as pd __all__ = ["Test1", "Test2", "assets", "scenarios", "outlook"] assets = 'DMEQ', 'EMEQ', 'PE', 'RE', 'NB', 'EILB', 'CASH' scenarios = 'Baseline', 'Goldilocks', 'Stagflation', 'HHT' outlook = pd.read_csv(os.path.join(os.path.dirname(__f...
StarcoderdataPython
6699883
##@package layer #@author <NAME> ## Layer of the system. # List the agents belonging to one layer. class Layer: ## Total number of layers. _layersNumber=0 ## Default constructor. # @param agentList Initial list of agents in the layer. # @param name Name of the layer. def __in...
StarcoderdataPython
11358706
# Copyright 2018 GoDaddy # Copyright (c) 2015 Rackspace # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
StarcoderdataPython
1681520
<reponame>albgar/aiida_siesta_plugin #!/usr/bin/env runaiida ''' This is an example of how to launch multiple SIESTA simulations iterating over one or more parameters using the aiida_siesta plugin. ''' #Not required by AiiDA import os.path as op import sys #AiiDA classes and functions from aiida.engine import submit...
StarcoderdataPython
5091508
"""py.test configuration.""" import os import tempfile from pathlib import Path import numpy as np import nibabel as nb import pytest from dipy.data.fetcher import _make_fetcher, UW_RW_URL _dipy_datadir_root = os.getenv("DMRIPREP_TESTS_DATA") or Path.home() dipy_datadir = Path(_dipy_datadir_root) / ".cache" / "data" d...
StarcoderdataPython
399915
<filename>alloy2vec/processing/data/clean_corpus.py import os,re,sys # initializing bad_chars_list bad_chars = [',', ';', ':', '!', '.', '(', ')', '"', "*"] #filename="mat2vec-1a5b3240-abstracts-head.csv" filename=sys.argv[1] #"mat2vec-1a5b3240-abstracts.csv" print(filename) filename_w="cleaned_"+filename with op...
StarcoderdataPython
1879229
# from.import invoice_report
StarcoderdataPython
5140239
<reponame>kkelchte/pilot #!/usr/bin/python # Block all numpy-scipy incompatibility warnings (could be removed at following scipy update (>1.1)) import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") import numpy as np...
StarcoderdataPython
6573472
<reponame>ScSteffen/neuralEntropyComparison ''' This is the script that gets called from the C++ KiT-RT method MLOptimizer.cpp It initializes and loads a neural Closure The call method performs a prediction Author: <NAME> Version: 0.0 Date 29.10.2020 ''' ### imports ### from src.neuralClosures.configModel import initN...
StarcoderdataPython
6653908
<reponame>TG-Techie/tg-gui from __future__ import annotations from typing import TYPE_CHECKING, Generic, TypeVar, Protocol from tg_gui_core import * from tg_gui_core.shared import Missing, MissingType, as_any if TYPE_CHECKING: from typing import ( Callable, ClassVar, Any, overload...
StarcoderdataPython
1866825
<reponame>Symantec/ccs-api-samples # Script to Search the asset group in the CCS system # For more details Refer the CCS REST API document at : https://apidocs.symantec.com/home/CCS import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning # Variable # Replace the <hostname> with...
StarcoderdataPython
1754028
<filename>252_meeting_rooms.py # # 252. Meeting Rooms # # Q: https://leetcode.com/problems/meeting-rooms/ # A: https://leetcode.com/problems/meeting-rooms/discuss/919342/Kt-Js-Py3-Cpp-Sort-%2B-Scan # from typing import List class Solution: def canAttendMeetings(self, A: List[List[int]], last = 0) -> bool: ...
StarcoderdataPython
3200312
<reponame>mickypaganini/everware<filename>everware/home_handler.py from tornado import web, gen from docker.errors import NotFound from jupyterhub.handlers.base import BaseHandler from IPython.html.utils import url_path_join from tornado.httputil import url_concat from tornado.httpclient import HTTPRequest, AsyncHTTPC...
StarcoderdataPython
1762666
<gh_stars>0 ''' Bool - A mutable bool class ################################################## ###### AUTOGENERATED - DO NOT EDIT DIRECTLY ###### ################################################## ''' from mutable_primitives.base import Mutable class Bool(Mutable): ''' Bool - A mutable bool class ''' base =...
StarcoderdataPython
298714
<reponame>kipkurui/gimmemotifs # Copyright (c) 2009-2010 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. """ Odds and ends that for which I didn't (yet) find another place """ # ...
StarcoderdataPython
46253
import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import dash_table import plotly.express as px import pandas as pd import requests from bs4 import BeautifulSoup import re from newspaper import Article import sys module_path = './que...
StarcoderdataPython
3229157
"""Test cases for ansatz-related utilities.""" import unittest from unittest import mock import numpy as np import numpy.testing from zquantum.core.interfaces.ansatz_utils import ( DynamicProperty, ansatz_property, combine_ansatz_params, invalidates_parametrized_circuit, ) class PseudoAnsatz: n_l...
StarcoderdataPython
271690
import tensorflow as tf import numpy as np import logging def crop_and_concat(net1, net2): """ the size(net1) <= size(net2) """ net1_shape = net1.get_shape().as_list() net2_shape = net2.get_shape().as_list() # print(net1_shape) # print(net2_shape) # if net2_shape[1] >= net1_shape[1] an...
StarcoderdataPython
1849851
<gh_stars>10-100 # Code créé par <NAME> le 7 Mai 2018 # Kolmogorov-Smyrnov Test extended to two dimensions. # References:s # [1] <NAME>. (1983). Two-dimensional goodness-of-fit testing # in astronomy. Monthly Notices of the Royal Astronomical Society, # 202(3), 615-627. # [2] <NAME>., & <NAME>. (1987). A multidime...
StarcoderdataPython
31780
<reponame>ramoslin02/binanceapi<filename>binanceapi/constant.py from enum import Enum class OrderStatus(object): """ Order Status """ NEW = "NEW" PARTIALLY_FILLED = "PARTIALLY_FILLED" FILLED = "FILLED" CANCELED = "CANCELED" PENDING_CANCEL = "PENDING_CANCEL" REJECTED = "REJECTED" ...
StarcoderdataPython
8045031
'''''' from flask import Flask from flask_login import LoginManager from flask_mongoengine import MongoEngine from config import Config db = MongoEngine() login_manager = LoginManager() #login_manager.session_protection = 'strong' #login_manager.login_view = 'auth.login' def create_app(config=Config.DEFAULT): ...
StarcoderdataPython
11373940
""" This file is written originally for testing the csv files directly in the test/ directory. Now as the DAG is going to call the parser and will create tables in the tables in the database, this file will be only for a reference on how to use Airflow DAGs and self-defined operators """ from datetime import datetime ...
StarcoderdataPython
8085002
#!/usr/bin/env python # -*- coding: utf-8 -*- import flwr as fl class AggregateCustomMetricStrategy(fl.server.strategy.FedAvg): def aggregate_evaluate( self, rnd: int, results, failures, ): """Aggregate evaluation losses using weighted average.""" if not result...
StarcoderdataPython
9672478
from rest_framework.response import Response import ippon.models.tournament as tm def has_tournament_authorization(allowed_master_statuses, pk, request): try: if not isinstance(allowed_master_statuses, list): allowed_master_statuses = [allowed_master_statuses] admin = tm.TournamentAdm...
StarcoderdataPython
1608136
# !usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. class CatalogdbError(Exception): """A custom core Catalogdb exception""" def __init__(self, message=None): message = 'There has been an error' \ if not message else message super(CatalogdbEr...
StarcoderdataPython
241257
from .toc import *
StarcoderdataPython
3261049
'''This test suite contains 3 passing tests. ''' import pytest from seleniumbase import BaseCase from basic_methods import BasicMethods as bm import config import constants as const import time class TestLogout(BaseCase): def test_LogoutClicked_MsgUserRedirected(self): ''' Checks if when us...
StarcoderdataPython
310635
<reponame>Yiling-J/pharos import yaml from unittest import TestCase, mock from jinja2 import PackageLoader, Environment, FileSystemLoader from kubernetes.dynamic import exceptions as api_exceptions from pharos import models, fields, exceptions, lookups, backend, jinja from pharos.jinja import to_yaml from pharos.backen...
StarcoderdataPython
293923
<filename>operators/bias_operators.py import random import copy import utils.constants as const import utils.properties as props import utils.exceptions as e import utils.mutation_utils as mu def operator_add_bias(model): if not model: print("raise,log we have probllems") current_index = props.add_...
StarcoderdataPython
1698263
<reponame>shrinandj/aim from typing import Generic, Union, Tuple, List, TypeVar, Dict from aim.storage.arrayview import ArrayView from aim.storage.context import Context from aim.storage.hashing import hash_auto from typing import TYPE_CHECKING if TYPE_CHECKING: from aim.sdk.run import Run T = TypeVar('T') ...
StarcoderdataPython
1670268
<gh_stars>0 """ @file setup.py @date 2008-09-16 Contributors can be viewed at: http://svn.secondlife.com/svn/linden/projects/2008/pyogp/CONTRIBUTORS.txt $LicenseInfo:firstyear=2008&license=apachev2$ Copyright 2008, Linden Research, Inc. Licensed under the Apache License, Version 2.0 (the "License"). You may obtain ...
StarcoderdataPython
6616746
# Generated by Django 2.2.2 on 2019-06-15 17:53 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Area', fields=[ ('id', models.AutoField(aut...
StarcoderdataPython
11286101
import grpc import numpy as np import evocraft_ga.external.minecraft_pb2_grpc as minecraft_pb2_grpc from evocraft_ga.external.minecraft_pb2 import * # noqa class Spawner: def __init__( self, start_x=20, start_y=10, start_z=20, cube_len=10, class_dict={0: AIR, 1: RE...
StarcoderdataPython
392272
<reponame>manulangat1/Jaza-ndai<filename>backend/blocks/fl.py # import flask from flask import Flask, jsonify,url_for from twilio.twiml.voice_response import VoiceResponse from twilio.rest import Client import json # Declare Flask application from flask_web3 import current_web3, FlaskWeb3 TWILIO_ACCOUNT_SID = "ACc8e3...
StarcoderdataPython
8098624
# folding.py import openpyxl def folding(path, rows=None, cols=None, hidden=True): workbook = openpyxl.Workbook() sheet = workbook.active if rows: begin_row, end_row = rows sheet.row_dimensions.group(begin_row, end_row, hidden=hidden) if cols: begin_col, end_col = cols ...
StarcoderdataPython
29127
<gh_stars>1-10 """ Show the INI config(s) used by a command tree. """ from .. import command class Show(command.Command): """ Show current INI configuration. Programs may make use of a configuration file which is usually located in your $HOME directory as .<prog>_config. The file is a standard INI ...
StarcoderdataPython
1849575
"""<NAME>'s aospy.Proj object for collaboration w/ Natalie Burls.""" import datetime import os from aospy.proj import Proj from aospy.model import Model from aospy.run import Run from aospy_user import regions _ROOT = os.path.join(os.environ['HOME'], 'Dropbox/projects/gms_natalie_burls') cam_2xco2 = Run( name='2...
StarcoderdataPython
6628977
<filename>problems/1021-remove-outermost-parentheses.py class Solution: """ 有效括号字符串为空 ("")、"(" + A + ")" 或 A + B,其中 A 和 B 都是有效的括号字符串,+ 代表字符串的连接。 例如,"","()","(())()" 和 "(()(()))" 都是有效的括号字符串。 如果有效字符串 S 非空,且不存在将其拆分为 S = A+B 的方法,我们称其为原语(primitive),其中 A 和 B 都是非空有效括号字符串。 给出一个非空有效字符串 S,考虑将其进行原语化分解,使得:S = P...
StarcoderdataPython
9604900
# Generated by Django 3.0.6 on 2020-05-05 14:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0007_auto_20200505_0704'), ] operations = [ migrations.AlterField( model_name='config', name='sslexpire', ...
StarcoderdataPython
1664854
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from hyperion.util.integrate import integrate_subset from scipy import stats from .units import ConvertUnits class MakePlots(object): ''' Plots slices of the val cube from SyntheticCube a the closest slice to wav_interest or val...
StarcoderdataPython
1825396
<reponame>dikyindrah/Python-Pemrograman-Dasar<filename>21-Operator Perbandingan/Script.py # Operator perbandingan print('\n==========Operator Perbandingan==========\n') x = int(input('Masukan nilai x: ')) y = int(input('Masukan nilai y: ')) print('') print(x, '==', y, ' =', (x==y)) print(x, '!=', y, ' =', (x!=y)) pr...
StarcoderdataPython
1792348
from .. import testing class CountIfTest(testing.FunctionalTestCase): filename = "IF.xlsx" def test_evaluation_ABCDE_1(self): for col in "ABCDE": cell = f'Sheet1!{col}1' excel_value = self.evaluator.get_cell_value(cell) value = self.evaluator.evaluate(cel...
StarcoderdataPython
179639
<reponame>jeremycward/ipp-core<gh_stars>1-10 import pandas as pd def header_cols(header): return (header.name, header.storage_method, header.path, str(header.memory_style), header.description) def mtx_headers_as_dataframe(matrix_headers): record_data = [header_co...
StarcoderdataPython
6557314
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from nltk import word_tokenize external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) server = app.server ...
StarcoderdataPython
1728600
from days import AOCDay, day import math from collections import defaultdict def borders(data): top = data[0] right = ''.join(line[-1] for line in data) bottom = data[-1] left = ''.join(line[0] for line in data) return (top, right, bottom, left) def mirrors(data): mirrors = [data] mirro...
StarcoderdataPython
1773694
<filename>chronostar/component.py """ Class object that encapsulates a component, the phase-space model of an unbound set of stars formed from the same starburst/filament. A component models the initial phase-space distribution of stars as a Gaussian. As such there are three key attributes: - mean: the central locatio...
StarcoderdataPython
3589645
<gh_stars>1-10 #!/usr/bin/python # Finds vulnerabilites in manifest files import sys from xml.dom.minidom import Element from androguard.core.bytecodes import apk from androguard.core.bytecodes import dvm import permissions # Component Types Enum ACTIVITY = 0 SERVICE = 1 RECEIVER = 2 PROVIDER = 3 tag2type = { "act...
StarcoderdataPython
5197057
#!/usr/bin/env python3 """ This script collects any vulnerabilities associated with the five C/C++ projects by scraping the CVE Details website. This information includes the CVE identifier, publish date, CVSS score, various impacts, vulnerability types, the CWE ID, and the URLs to other relevant websites like a ...
StarcoderdataPython
1788802
#!/usr/bin/env python # # Copyright (c) 2015, Arista Networks, 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: # - Redistributions of source code must retain the above copyright notice, # ...
StarcoderdataPython
9786901
import numpy as np import tensorflow as tf from config import MovieQAPath from legacy.input import Input _mp = MovieQAPath() hp = {'emb_dim': 300, 'feat_dim': 512, 'learning_rate': 10 ** (-4), 'decay_rate': 0.97, 'decay_type': 'exp', 'decay_epoch': 2, 'opt': 'adam', 'checkpoint': '', 'dropout_rate': 0.1, ...
StarcoderdataPython
1641636
<filename>gps/pasing/google_parser.py import datetime import json import pickle import time as t from pathlib import Path url = "/Users/rohit/Downloads/Takeout/Location_History/Location_History.json" class Location: latitude = None longitude = None date = None milisec = None accuracy = None ...
StarcoderdataPython
226300
# coding: utf-8 # Copyright (c) 2016, <NAME> (alexpirine), 2016 import itertools import re import sudokumaker from django.contrib import messages from django.shortcuts import render from sudoku import SudokuProblem from . import forms # Create your views here. def home(request): action = request.POST.get('actio...
StarcoderdataPython
5051666
# -*- coding: utf-8 -*- """ Created on Fri Apr 30 08:48:06 2021 @author: u0139894 """ import numpy as np import os class Model: def __init__(self, modelPath, initial): self.modelPath = modelPath self.initial = initial self.__getMets() self.__getReacs() def __get...
StarcoderdataPython
1759033
# -*- coding: utf-8 -*- import time from pykinect2 import PyKinectV2 from pykinect2.PyKinectV2 import * from pykinect2 import PyKinectRuntime from Kinetic import extractPoints from numpy import * #import pyttsx k = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Body) print "Kinect lance" #e = pyttsx.ini...
StarcoderdataPython
43508
<reponame>ekkipermana/robotframework-test """ dexml: a dead-simple Object-XML mapper for Python Let's face it: xml is a fact of modern life. I'd even go so far as to say that it's *good* at what is does. But that doesn't mean it's easy to work with and it doesn't mean that we have to like it. Most of the time, ...
StarcoderdataPython
1950756
<filename>makeCourse/plastex/appendixnumberbeamer/__init__.py from plasTeX.PackageResource import (PackageResource, PackageCss, PackageJs, PackageTemplateDir) from plasTeX import Command, Environment, sourceArguments def ProcessOptions(options, document): tpl = PackageTemplateDir(renderers='html5',package='appendi...
StarcoderdataPython
3463498
import numpy as np import matplotlib.pyplot as plt def generate_linerp_plot(linerp_vals_train, linerp_vals_test, title:str=''): xs_train = np.linspace(0, 1, len(linerp_vals_train)) xs_test = np.linspace(0, 1, len(linerp_vals_test)) fig = plt.figure(figsize=(8, 5)) if title != '': plt.title(title) ...
StarcoderdataPython
280797
import os import struct import re import logging NFD_LABEL = "feature.node.kubernetes.io/cpu-power.sst_bf.enabled" def get_cpu_count(): dirs = os.listdir("/sys/devices/system/cpu") return len([c for c in dirs if re.search(r"^cpu[0-9]+$", c)]) def read_msr(msr, cpu=0): try: with open("/dev/cpu/{...
StarcoderdataPython
8073452
<gh_stars>0 import pkg_resources from .core import RedisChannelLayer from .local import RedisLocalChannelLayer __version__ = pkg_resources.require('asgi_redis')[0].version
StarcoderdataPython
4803930
<reponame>leylop/correlation_viewer __author__ = 'Diego' import os import PyQt4.uic if __name__ == '__main__': this_dir=os.path.dirname(__file__) qt_gui_dir=os.path.join(this_dir,'gui') PyQt4.uic.compileUiDir(qt_gui_dir)
StarcoderdataPython
12838132
<reponame>ldimaggi/acceptance-testing<gh_stars>0 # # Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
StarcoderdataPython
1900266
class TelegramData: def __init__(self, autoconv, users): self.autoconv = autoconv self.update = None self.context = None self.telegram_id = None self.udata = None self.sdata = None self.message = None self.chat_type = None self.exception = None...
StarcoderdataPython
300326
<reponame>yunzhang599/Python3_Package_Examples<gh_stars>1-10 # full pymongo documentation # http://api.mongodb.org/python/current/ import pymongo client = pymongo.MongoClient("localhost", 27017) db = client.test print db.name print db.my_collection db.my_collection.save({"x": 10}) db.my_collection.save(...
StarcoderdataPython
1826548
#!/usr/bin/env python """ Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ import os import re import socket import threading import time class DNSQuery(object): """ Used for making fake DNS resolution responses based on received raw request...
StarcoderdataPython
1933206
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import tempfile from metrics import loading from telemetry.core.platform.profiler import perf_profiler from telemetry.page import page_measurement...
StarcoderdataPython
6446241
<gh_stars>1-10 # coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model from swagger_server import util class BeaconKnowledgeMapPredicate(Model): """NOTE: This class i...
StarcoderdataPython
1988848
from setuptools import setup import os.path import sys setup( name='pysetupdi', version='2018.10.22', packages=['pysetupdi'], url='https://github.com/gwangyi/pysetupdi', license='MIT', author='<NAME>', author_email='<EMAIL>', description='Python SetupAPI wrapper', platforms=['win32'...
StarcoderdataPython