Read input as file or string input

 @param input [Object]
770527
def read(input)
      if input.is_a? Symbol
        @file = File.expand_path get_eval_file input
        File.read @file
      else
        @file = File.expand_path __FILE__
        input
      end
    end
489550
function parseObj (input) {
  try {
    return require(path.resolve(input));
  } catch (e) {
    var str;
    try {
      str = fs.readFileSync(program.obj, 'utf8');
    } catch (e) {
      str = program.obj;
    }
    try {
      return JSON.parse(str);
    } catch (e) {
      return eval('(' + str + ')');
    }
  }
}
1235157
def read
      text = @filetype.read
      if text.nil?
        raise IniParseError, _("Cannot read nonexistent file %{file}") % { file: @file.inspect }
      end
      parse(text)
    end
810481
public static String readFile(String input) throws Exception {
		char[] buffer = new char[4096];
		int len = 0;
		StringBuilder content = new StringBuilder(4096);

		if (ENCODING == null)
			ENCODING = PropsUtil.ENCODING;
		InputStreamReader fr = null;
		BufferedReader br = null;
		try {
			fr = new InputStreamReader(new FileInputStream(input), ENCODING);
			br = new BufferedReader(fr);
			while ((len = br.read(buffer)) > -1) {
				content.append(buffer, 0, len);
			}
		} catch (Exception e) {
			throw new Exception(e);
		} finally {
			if (br != null)
				br.close();
			if (fr != null)
				fr.close();
		}
		return content.toString();
	}
121350
protected Reader toReader(Object input) throws IOException {
        if (input instanceof Reader) {
            return (Reader) input;
        }

        if (input instanceof InputStream) {
            return new InputStreamReader((InputStream) input);
        }

        if (input instanceof String) {
            return new StringReader((String) input);
        }

        if (input instanceof URL) {
            return new InputStreamReader(((URL) input).openStream());
        }

        if (input instanceof File) {
            return new FileReader((File) input);
        }

        throw new IllegalArgumentException("Unable to turn " + input + " into reader");
    }
209914
def file_or_filename(input):
    
    if isinstance(input, string_types):
        # input was a filename: open as file
        yield smart_open(input)
    else:
        # input already a file-like object; just reset to the beginning
        input.seek(0)
        yield input
449500
def input_strings(strings, options={})
      params = {:input => format_input_strings(strings)}
      if options[:tag] # include the :tag if there is one
        params[:tag] = options[:tag]
      end
      post("string/input", params)
    end
247182
public void load(BufferedReader input) throws IOException {
    String line;
    while( (line=input.readLine()) != null ) {
      if( StringUtils.matches(line, "\\s*(%.*)?") ) {
        // comment or blank line
        System.err.println("Skipping: " + line);
        continue;
      }
      char [] linechars = line.toCharArray();
      int [] pattern = new int[linechars.length];
      char [] chars  = new char[linechars.length];
      int c = 0;
      for( int i = 0; i < linechars.length; ++i) {
        if( Character.isDigit(linechars[i]) ) {
          pattern[c] = Character.digit(linechars[i], 10);
        } else {
          chars[c++] = linechars[i];
        }
      }
      char[] shortchars = new char[c];
      int [] shortpattern = new int[c+1];
      System.arraycopy(chars, 0, shortchars, 0, c);
      System.arraycopy(pattern, 0, shortpattern, 0, c+1);
      insertHyphPattern(shortchars, shortpattern);
    }
  }
1137354
public static String readLine(final InputStream input) throws IOException {
		return new BufferedReader(new InputStreamReader(input, Charsets.UTF_8)).readLine();
	}
1218318
def scope=(input)
      @scope = (input.instance_of?(Redistat::Scope)) ? input : Scope.new(input)
    end
624312
def get_eval_file(input)
      input = input.to_s
      unless File.extname(input) == Settings::FILE_EXTENSION
        input += Settings::FILE_EXTENSION
      end
      input
    end
667613
def parse(input_: Union[str, FileStream], source: str) -> Optional[str]:
    

    # Step 1: Tokenize the input stream
    error_listener = ParseErrorListener()
    if not isinstance(input_, FileStream):
        input_ = InputStream(input_)
    lexer = jsgLexer(input_)
    lexer.addErrorListener(error_listener)
    tokens = CommonTokenStream(lexer)
    tokens.fill()
    if error_listener.n_errors:
        return None

    # Step 2: Generate the parse tree
    parser = jsgParser(tokens)
    parser.addErrorListener(error_listener)
    parse_tree = parser.doc()
    if error_listener.n_errors:
        return None

    # Step 3: Transform the results the results
    parser = JSGDocParser()
    parser.visit(parse_tree)

    if parser.undefined_tokens():
        for tkn in parser.undefined_tokens():
            print("Undefined token: " + tkn)
        return None

    return parser.as_python(source)
45244
def files(input)
      (::Readline::FILENAME_COMPLETION_PROC.call(input) || []).map {|f|
        f =~ /^~/ ?  File.expand_path(f) : f
      }
    end
452977
public static String[] asStringArray(List<String> input) {
		String[] result = new String[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
1214059
@Deprecated
    @Override
    public void read(final File input) {
        assert input.isAbsolute();
        read(input.toURI());
    }
672796
def read_file(path)
      result = nil
      File.open(path, 'rb', encoding: 'UTF-8') { |f| result = f.read }
      result
    end
535654
function assembleInput(input) {
  if (_.isArray(input.context)) {
    return input.context;
  }
  var result = (input.prefix || '') + (input.context || '') + (input.suffix || '');
  return strip(result);
}